Bug 742438: Fix straggling bool-vs-NULL comparison after HashSet::put return-type change. r=terrence
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 04 Apr 2012 11:18:18 -0700
changeset 90992 c508a51af8435d6b8a6687fb2f5164d69908039d
parent 90991 e55c365618ab33e6a2894e9f60093a3ad3f74eb1
child 90993 a268ac68fb5865378aee78d8e0861e10bd8526d5
push id7960
push userdholbert@mozilla.com
push dateWed, 04 Apr 2012 18:24:39 +0000
treeherdermozilla-inbound@a268ac68fb58 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs742438
milestone14.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 742438: Fix straggling bool-vs-NULL comparison after HashSet::put return-type change. r=terrence
js/public/HashTable.h
js/src/shell/jsworkers.cpp
--- a/js/public/HashTable.h
+++ b/js/public/HashTable.h
@@ -1148,17 +1148,17 @@ class HashMap
     unsigned generation() const                       { return impl.generation(); }
 
     /* Shorthand operations: */
 
     bool has(const Lookup &l) const {
         return impl.lookup(l) != NULL;
     }
 
-    /* Overwrite existing value with v. Return NULL on oom. */
+    /* Overwrite existing value with v. Return false on oom. */
     template<typename KeyInput, typename ValueInput>
     bool put(const KeyInput &k, const ValueInput &v) {
         AddPtr p = lookupForAdd(k);
         if (p) {
             p->value = v;
             return true;
         }
         return add(p, k, v);
--- a/js/src/shell/jsworkers.cpp
+++ b/js/src/shell/jsworkers.cpp
@@ -162,17 +162,17 @@ class WorkerParent {
   public:
     virtual PRLock *getLock() = 0;
     virtual ThreadPool *getThreadPool() = 0;
     virtual bool post(Event *item) = 0;  // false on OOM or queue closed
     virtual void trace(JSTracer *trc) = 0;
 
     bool addChild(Worker *w) {
         AutoLock hold(getLock());
-        return children.put(w) != NULL;
+        return children.put(w);
     }
 
     // This must be called only from GC or when all threads are shut down. It
     // does not bother with locking.
     void removeChild(Worker *w) {
         ChildSet::Ptr p = children.lookup(w);
         JS_ASSERT(p);
         children.remove(p);