diff lisp/json.el @ 98553:4b085b844163

(json-advance): Use forward-char. (json-skip-whitespace): Use skip-syntax-forward.
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 07 Oct 2008 16:18:22 +0000
parents 5d474cdb19f8
children e26dedf05927
line wrap: on
line diff
--- a/lisp/json.el	Tue Oct 07 16:18:01 2008 +0000
+++ b/lisp/json.el	Tue Oct 07 16:18:22 2008 +0000
@@ -123,11 +123,7 @@
 
 (defsubst json-advance (&optional n)
   "Skip past the following N characters."
-  (unless n (setq n 1))
-  (let ((goal (+ (point) n)))
-    (goto-char goal)
-    (when (< (point) goal)
-      (signal 'end-of-file nil))))
+  (forward-char n))
 
 (defsubst json-peek ()
   "Return the character at point."
@@ -144,8 +140,7 @@
 
 (defun json-skip-whitespace ()
   "Skip past the whitespace at point."
-  (while (looking-at "[\t\r\n\f\b ]")
-    (goto-char (match-end 0))))
+  (skip-syntax-forward " "))