twitter-archive / kestrel

simple, distributed message queue system (inactive)
http://twitter.github.io/kestrel
Other
2.77k stars 312 forks source link

String split typo #10

Closed durana closed 14 years ago

durana commented 14 years ago

I'm very new to Scala and I know next to nothing about the Memcache protocol, so forgive me if this is incorrect. At KestrelHandler.scala:156 there is

val options = name.split("/")

and I believe it should be

val options = name.split('/')

qhoxie commented 14 years ago

These should both behave the same. Did you see this cause a problem somewhere?

durana commented 14 years ago

My mistake. I was working in the Scala interactive shell while reading through this code. I tried to split a string on "." and "blah.blah".split(".") does not appear to behave the same as "blah.blah".split('.'). I assumed it was the difference between "." being a String and '.' being a Char. I feel stupid now for not actually trying it with "/" before submitting this. ;)

robey commented 14 years ago

ah, yeah, the string version is interpreted as a regex. (this API comes from java.) so "." means single-char wildcard in that context. :)