c8dfeadbf86dfcf666f5341af97cb6ec894c44d0,src/python/pants/engine/subsystem/native.py,ExternContext,put,#ExternContext#Any#,376

Before Change


  def put(self, obj):
    with self._lock:
      // If we encounter an existing id, return it.
      new_id = self._id_generator
      _id = self._obj_to_id.setdefault(obj, new_id)
      if _id is not new_id:
        // Object already existed.
        return _id

      // Object is new/unique.
      self._id_to_obj[_id] = obj
      self._id_generator += 1
      return _id

  def get(self, id_):
    return self._id_to_obj[id_]

After Change


  def put(self, obj):
    with self._lock:
      // If we encounter an existing id, return it.
      return self._object_id_map.put(obj)

  def get(self, id_):
    return self._object_id_map.get(id_)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: pantsbuild/pants
Commit Name: c8dfeadbf86dfcf666f5341af97cb6ec894c44d0
Time: 2017-02-05
Author: wangpeiyu@gmail.com
File Name: src/python/pants/engine/subsystem/native.py
Class Name: ExternContext
Method Name: put


Project Name: CellProfiler/CellProfiler
Commit Name: 34252cb69b44438cdcb3df396c3af066f1853e5a
Time: 2020-07-31
Author: dstirling@broadinstitute.org
File Name: cellprofiler/gui/utilities/module_view.py
Class Name:
Method Name: stop_validation_queue_thread


Project Name: Ambrosys/glyph
Commit Name: ffa0db4fdca9cef31a72b35a1f7eef78733f5b0c
Time: 2017-02-24
Author: mquade@uni-potsdam.de
File Name: glyph/cli/glyph_remote.py
Class Name: RemoteAssessmentRunner
Method Name: evaluate_single


Project Name: stratosphereips/StratosphereLinuxIPS
Commit Name: bfff0cb09ae56b722c03f014337346c3a095abea
Time: 2019-04-02
Author: eldraco@gmail.com
File Name: slips.py
Class Name:
Method Name: