Closed Bug 483977 Opened 15 years ago Closed 15 years ago

nsCSSScanner: Simplify IsDigit

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
trivial

Tracking

()

RESOLVED FIXED
mozilla1.9.3a1

People

(Reporter: alfredkayser, Assigned: alfredkayser)

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

one could replace 
  IsDigit{return PRUint32(ch) < 256 && (gLexTable[ch] & IS_DIGIT) != 0;}
with
  IsDigit(return (ch>='0' && ch <='9');}

As that won't require a reference to a table and performing a bit operation on
value, just two compares, which is inlined much better.
Attached patch Simplify IsDigit (obsolete) — Splinter Review
Assignee: nobody → alfredkayser
Status: NEW → ASSIGNED
Attachment #368005 - Flags: review?(dbaron)
Comment on attachment 368005 [details] [diff] [review]
Simplify IsDigit

r+sr=dbaron
Attachment #368005 - Flags: superreview+
Attachment #368005 - Flags: review?(dbaron)
Attachment #368005 - Flags: review+
Flags: wanted1.9.1?
Whiteboard: [checkin needed]
Keywords: checkin-needed
Whiteboard: [checkin needed]
Flags: wanted1.9.1? → wanted1.9.1-
Looks like that patch doesn't apply anymore. Also, it should be a proper hg diff.
Keywords: checkin-needed
Attachment #368005 - Attachment is obsolete: true
This is still a clean patch, and is still valid to be checked in.
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/5fda24bc3679
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: