[Webkit-unassigned] [Bug 42976] Implement IDBKeyPath parser.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 27 08:33:35 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=42976





--- Comment #7 from Adam Barth <abarth at webkit.org>  2010-07-27 08:33:35 PST ---
(From update of attachment 62593)
WebCore/storage/IDBKeyPath.cpp:193
 +      return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
Should we use the version of this function in ASCIITypes.h?

WebCore/storage/IDBKeyPath.cpp:203
 +          token.start = token.end = m_ptr;
Please don't use this form of assignment.

WebCore/storage/IDBKeyPath.cpp:206
 +      ASSERT(m_ptr <= m_end);
Should this be m_ptr < m_end ?

WebCore/storage/IDBKeyPath.cpp:237
 +      return TokError;
I'd move this into the default case, but that's just a stylistic point.

WebCore/storage/IDBKeyPath.cpp:242
 +      const UChar* runStart = m_ptr;
I'd just call that "start"

WebCore/storage/IDBKeyPath.cpp:249
 +      token.stringToken = builder.toString();
Why are we using a string builder here?  The append is outside the loop.

WebCore/storage/IDBKeyPath.cpp:265
 +          return TokError;
so 01 only tokenizes the "0" and leaves the 1.  I presume that's what you mean.

WebCore/storage/IDBKeyPath.cpp:271
 +      for (i = 0; i < token.end - token.start; i++) {
Please break "token.end - token.start" out as a length variable since you're using it more than once.

WebCore/storage/IDBKeyPath.cpp:275
 +      buffer[i] = 0;
Yuck.  This seems error prone.  I can see that it's correct, but just computing the int directly seems way easier.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list