[tor-bugs] #17824 [metrics-lib]: switch on string instead of many if-else with String comparison

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Dec 12 07:43:10 UTC 2015


#17824: switch on string instead of many if-else with String comparison
-------------------------+--------------------------
 Reporter:  iwakeh       |          Owner:  karsten
     Type:  enhancement  |         Status:  accepted
 Priority:  Low          |      Milestone:
Component:  metrics-lib  |        Version:
 Severity:  Minor        |     Resolution:
 Keywords:               |  Actual Points:
Parent ID:  #17822       |         Points:
  Sponsor:               |
-------------------------+--------------------------
Changes (by karsten):

 * status:  new => accepted


Comment:

 Sure, sounds like a good change.

 I wonder how we would handle chained if-else statements with some if's
 checking for `equals()` and others checking for `startsWith()` or using
 other methods.  But I don't know if there are such cases in the current
 code.  Just a thought.

 I guess the more important question is the same as for #17823: how can we
 best avoid making this change while we both have unmerged branches lying
 around?  Shortly before the next release?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17824#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list