Skip to content

Instantly share code, notes, and snippets.

@nitsanw
Last active December 7, 2015 16:11
Show Gist options
  • Save nitsanw/f677c6162e662c4525ed to your computer and use it in GitHub Desktop.
Save nitsanw/f677c6162e662c4525ed to your computer and use it in GitHub Desktop.
//... same as before
@Param({ "10" })
int k;
@Benchmark
@Group("run_together")
public boolean contains1ToK() {
byte[] haystack = soggyBottoms;
for (int needle = 1; needle <= k; needle++) {
if (containsNeedle(needle, haystack)) {
return true;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment