Closed Bug 1299534 Opened 8 years ago Closed 8 years ago

TraceLogger: Use Map for color lookup instead of switch

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: sfink, Assigned: sfink)

References

Details

Attachments

(1 file)

Totally unnecessary -- I just always notice when a switch statement is being used as a lookup table.
On the other hand, the JS alternative isn't exactly beautiful either. You can decide which you'd rather use.
Attachment #8786793 - Flags: review?(hv1989)
Comment on attachment 8786793 [details] [diff] [review]
Use Map for color lookup instead of switch

Review of attachment 8786793 [details] [diff] [review]:
-----------------------------------------------------------------

For now I'll leave this. A switch is still faster than a Map. As a result the old code performs better.
Attachment #8786793 - Flags: review?(hv1989)
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: