#754: Complete implementation of switch statement
----------------------------+------------------------
Reporter: seth | Owner: robin
Type: Merge Request | Status: closed
Priority: Normal | Milestone: Bro2.2
Component: Bro | Version: git/master
Resolution: fixed | Keywords: language
----------------------------+------------------------
Comment (by jsiwek):
Replying to [comment:5 vern]:
> (1) what in particular is motivating this addition right now
It's just what I felt like working on that day.
> (2) thoughts on making it more dynamics?
For constant case labels, an internal hash map lookup can be done when
evaluating the switch instead of iterating over them (and evaluating) to
look for the first match. I didn't do any measurements, but I think that
way would match people's performance expectations for a switch with a
modest amount of cases because other languages do it similarly?
But I'm not completely attached to that way and it shouldn't be difficult
to remove that constant-only case label restriction, so let me know if
you're not persuaded.
--
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/754#comment:6>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker
_______________________________________________
bro-dev mailing list
[email protected]
http://mailman.icsi.berkeley.edu/mailman/listinfo/bro-dev