diff options
Diffstat (limited to 'chromium/chrome/renderer/resources/extensions/enterprise_platform_keys/utils.js')
-rw-r--r-- | chromium/chrome/renderer/resources/extensions/enterprise_platform_keys/utils.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chromium/chrome/renderer/resources/extensions/enterprise_platform_keys/utils.js b/chromium/chrome/renderer/resources/extensions/enterprise_platform_keys/utils.js new file mode 100644 index 00000000000..7bfbbf5392f --- /dev/null +++ b/chromium/chrome/renderer/resources/extensions/enterprise_platform_keys/utils.js @@ -0,0 +1,16 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Returns the intersection of the arrays |a| and |b|, which do not have to be +// sorted. +function intersect(a, b) { + var result = []; + for (var i = 0; i < a.length; i++) { + if (b.indexOf(a[i]) >= 0) + result.push(a[i]); + } + return result; +}; + +exports.intersect = intersect; |