Update AtomicHashMap.md
authorSrinivas \"Teja\" Rao <kirtiteja@gmail.com>
Thu, 17 Nov 2016 22:55:03 +0000 (14:55 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Thu, 17 Nov 2016 23:08:41 +0000 (15:08 -0800)
Summary:
it seems second is the boolean that we need to compare.
Closes https://github.com/facebook/folly/pull/518

Differential Revision: D4197096

Pulled By: yfeldblum

fbshipit-source-id: 71987dafac0ddbdb7817b55732619edbe9aed81b

folly/docs/AtomicHashMap.md

index 978df241d636b89af8a5bab9473048e41c7656fa..7522dcdf67456ae2660db1da24c573eb42217283 100644 (file)
@@ -74,7 +74,7 @@ string.
 
      void increment(int64_t obj_id) {
        auto ret = ahm.insert(make_pair(obj_id, 1));
-       if (!ret.first) {
+       if (!ret.second) {
          // obj_id already exists, increment
          NoBarrier_AtomicIncrement(&ret.first->second, 1);
        }