]> code.delx.au - gnu-emacs/blobdiff - lisp/json.el
* net/tramp.el (tramp-read-passwd): Cached passwords shall still be used.
[gnu-emacs] / lisp / json.el
index 38ec16f5db7b7775a476e358c7f6acbe424cd53e..8dee2b24cacc2430817125693575034eead4223e 100644 (file)
@@ -1,6 +1,6 @@
 ;;; json.el --- JavaScript Object Notation parser / generator
 
-;; Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Edward O'Connor <ted@oconnor.cx>
 ;; Version: 1.2
@@ -123,11 +123,7 @@ this around your call to `json-read' instead of `setq'ing it.")
 
 (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 @@ this around your call to `json-read' instead of `setq'ing it.")
 
 (defun json-skip-whitespace ()
   "Skip past the whitespace at point."
-  (while (looking-at "[\t\r\n\f\b ]")
-    (goto-char (match-end 0))))
+  (skip-chars-forward "\t\r\n\f\b "))
 
 \f