• R/O
  • SSH
  • HTTPS

yash: Commit


Commit MetaInfo

Revision3881 (tree)
Time2018-09-19 00:55:23
Authormagicant

Log Message

Simplify count_name_length function

Change Summary

Incremental Difference

--- yash/branches/token_based_parser/parser.c (revision 3880)
+++ yash/branches/token_based_parser/parser.c (revision 3881)
@@ -891,14 +891,11 @@
891891 * variable/alias name under the current position is fully available. */
892892 size_t count_name_length(parsestate_T *ps, bool isnamechar(wchar_t c))
893893 {
894- size_t saveindex = ps->index;
895- while (maybe_line_continuations(ps, ps->index),
896- isnamechar(ps->src.contents[ps->index]))
897- ps->index++;
898-
899- size_t result = ps->index - saveindex;
900- rewind_index(ps, saveindex);
901- return result;
894+ size_t index = ps->index;
895+ while (maybe_line_continuations(ps, index),
896+ isnamechar(ps->src.contents[index]))
897+ index++;
898+ return index - ps->index;
902899 }
903900
904901 /* Advances the current position `ps->index', skipping blank characters,
Show on old repository browser