Bug 1592992 - Part 1: Remove unused jsutil functions. r=jonco
authorAndré Bargull <andre.bargull@gmail.com>
Fri, 08 Nov 2019 11:02:20 +0000
changeset 501253 3cd1ccce483f7f5be21da8a1edafe7bad11d22d2
parent 501252 6d393135fdb9709fea22203fd3bb4b772db1d868
child 501254 39d4f511997aad7d3f138fdcdaa9b846e2ab50f7
push id114168
push userdluca@mozilla.com
push dateSun, 10 Nov 2019 03:08:55 +0000
treeherdermozilla-inbound@33f64c1ef3e4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1592992
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1592992 - Part 1: Remove unused jsutil functions. r=jonco AddContainerToHash and ForEach aren't used (anymore). Differential Revision: https://phabricator.services.mozilla.com/D51360
js/src/jsutil.h
--- a/js/src/jsutil.h
+++ b/js/src/jsutil.h
@@ -107,46 +107,30 @@ static inline T* Find(T* beg, T* end, co
 }
 
 template <class Container>
 static inline typename Container::ElementType* Find(
     Container& c, const typename Container::ElementType& v) {
   return Find(c.begin(), c.end(), v);
 }
 
-template <typename InputIterT, typename CallableT>
-void ForEach(InputIterT begin, InputIterT end, CallableT f) {
-  for (; begin != end; ++begin) {
-    f(*begin);
-  }
-}
-
 template <class Container1, class Container2>
 static inline bool EqualContainers(const Container1& lhs,
                                    const Container2& rhs) {
   if (lhs.length() != rhs.length()) {
     return false;
   }
   for (size_t i = 0, n = lhs.length(); i < n; i++) {
     if (lhs[i] != rhs[i]) {
       return false;
     }
   }
   return true;
 }
 
-template <class Container>
-static inline HashNumber AddContainerToHash(const Container& c,
-                                            HashNumber hn = 0) {
-  for (size_t i = 0; i < c.length(); i++) {
-    hn = mozilla::AddToHash(hn, HashNumber(c[i]));
-  }
-  return hn;
-}
-
 template <class T>
 static constexpr inline T Min(T t1, T t2) {
   return t1 < t2 ? t1 : t2;
 }
 
 template <class T>
 static constexpr inline T Max(T t1, T t2) {
   return t1 > t2 ? t1 : t2;