Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(961)

Unified Diff: res/js/common.js

Issue 1662373002: Add UI to filter fuzzes based on tags. (Closed) Base URL: https://skia.googlesource.com/buildbot@add-asan
Patch Set: remove conflicting status-sk elements Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « res/imp/9/url-params-sk-demo.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: res/js/common.js
diff --git a/res/js/common.js b/res/js/common.js
index fdf0053a0fd8948c7e5b5fe2f6c5e37bf3d16783..dc8939acd5670c3d2122cb231bcc35d387aba582 100644
--- a/res/js/common.js
+++ b/res/js/common.js
@@ -673,6 +673,23 @@ this.sk = this.sk || function() {
}
+ // Returns true if the sorted arrays a and b
+ // contain at least one element in common
+ sk.sharesElement = function(a, b) {
+ var i = 0;
+ var j = 0;
+ while (i < a.length && j < b.length) {
+ if (a[i] < b[j]) {
+ i++;
+ } else if (b[j] < a[i]) {
+ j++;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
// Polyfill for String.startsWith from
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith#Polyfill
// returns true iff the string starts with the given prefix
« no previous file with comments | « res/imp/9/url-params-sk-demo.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698