Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit cda3b85

Browse files
committed
Get rid of COLON_COLON_REGEX constant
According to @charliesome this is no more efficient than using the literal inline.
1 parent bdc19c3 commit cda3b85

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/statsd.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ def namespace=(namespace)
4545
#characters that will be replaced with _ in stat names
4646
RESERVED_CHARS_REGEX = /[\:\|\@]/
4747

48-
COLON_COLON_REGEX = /::/
49-
5048
COUNTER_TYPE = "c".freeze
5149
TIMING_TYPE = "ms".freeze
5250
GAUGE_TYPE = "g".freeze
@@ -139,7 +137,7 @@ def sampled(sample_rate)
139137
def send(stat, delta, type, sample_rate=1)
140138
sampled(sample_rate) do
141139
stat = stat.to_s.dup
142-
stat.gsub!(COLON_COLON_REGEX, ".".freeze)
140+
stat.gsub!(/::/, ".".freeze)
143141
stat.gsub!(RESERVED_CHARS_REGEX, "_".freeze)
144142

145143
msg = ""

0 commit comments

Comments
 (0)