MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / _swap

Method _swap

src/randomtrackingdict.py:25–34  ·  view source on GitHub ↗
(self, i1, i2)

Source from the content-addressed store, hash-verified

23 return self.dictionary[key][1]
24
25 def _swap(self, i1, i2):
26 with self.lock:
27 key1 = self.indexDict[i1]
28 key2 = self.indexDict[i2]
29 self.indexDict[i1] = key2
30 self.indexDict[i2] = key1
31 self.dictionary[key1][0] = i2
32 self.dictionary[key2][0] = i1
33 # for quick reassignment
34 return i2
35
36 def __setitem__(self, key, value):
37 with self.lock:

Callers 3

__setitem__Method · 0.95
__delitem__Method · 0.95
randomKeysMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected