Skip to content

Commit

Permalink
Identity is not the same thing as equality in Python
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored and yonghong-song committed Jul 17, 2019
1 parent 60944a4 commit f84e55c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/python/bcc/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ def __init__(self, *args, **kwargs):
self.total_cpu = len(get_possible_cpus())
# This needs to be 8 as hard coded into the linux kernel.
self.alignment = ct.sizeof(self.sLeaf) % 8
if self.alignment is 0:
if self.alignment == 0:
self.Leaf = self.sLeaf * self.total_cpu
else:
# Currently Float, Char, un-aligned structs are not supported
Expand All @@ -739,7 +739,7 @@ def __init__(self, *args, **kwargs):

def getvalue(self, key):
result = super(PerCpuHash, self).__getitem__(key)
if self.alignment is 0:
if self.alignment == 0:
ret = result
else:
ret = (self.sLeaf * self.total_cpu)()
Expand Down Expand Up @@ -782,7 +782,7 @@ def __init__(self, *args, **kwargs):
self.total_cpu = len(get_possible_cpus())
# This needs to be 8 as hard coded into the linux kernel.
self.alignment = ct.sizeof(self.sLeaf) % 8
if self.alignment is 0:
if self.alignment == 0:
self.Leaf = self.sLeaf * self.total_cpu
else:
# Currently Float, Char, un-aligned structs are not supported
Expand All @@ -795,7 +795,7 @@ def __init__(self, *args, **kwargs):

def getvalue(self, key):
result = super(PerCpuArray, self).__getitem__(key)
if self.alignment is 0:
if self.alignment == 0:
ret = result
else:
ret = (self.sLeaf * self.total_cpu)()
Expand Down

0 comments on commit f84e55c

Please sign in to comment.