ledisdb/server/util.go

26 lines
314 B
Go
Raw Normal View History

2014-06-09 13:23:32 +04:00
package server
2015-03-23 14:50:37 +03:00
import ()
2014-10-30 07:48:52 +03:00
func lowerSlice(buf []byte) []byte {
for i, r := range buf {
if 'A' <= r && r <= 'Z' {
r += 'a' - 'A'
}
buf[i] = r
}
return buf
}
func upperSlice(buf []byte) []byte {
for i, r := range buf {
if 'a' <= r && r <= 'z' {
r -= 'a' - 'A'
}
buf[i] = r
}
return buf
}