Navigation Menu

Skip to content

Commit

Permalink
Make sure the string has the same length
Browse files Browse the repository at this point in the history
The benchmarks tries to expose different comparison times based
on starting / ending with a different character so it shouldn't
trigger the shortcut we have that checks length first.
  • Loading branch information
dbussink committed Mar 13, 2011
1 parent ccb8857 commit 771e8c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion benchmark/core/string/bench_equal.rb
Expand Up @@ -2,7 +2,7 @@
require 'benchmark/ips'

Benchmark.ips do |x|
string_a = "#{'a' * 1_000}"
string_a = "#{'a' * 1_001}"
first_char_different = "b#{'a' * 1_000}"
last_char_different = "#{'a' * 1_000}b"
same = string_a.dup
Expand Down

0 comments on commit 771e8c6

Please sign in to comment.