From dd7009b68c04e0f7df01c03ad812eb8f673b4974 Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Mon, 6 Aug 2018 16:02:18 -0400 Subject: [PATCH] Conditional: Remove unnecessary copy and pickling methods. --- setools/policyrep/boolcond.pxi | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/setools/policyrep/boolcond.pxi b/setools/policyrep/boolcond.pxi index bff3a60..a61331d 100644 --- a/setools/policyrep/boolcond.pxi +++ b/setools/policyrep/boolcond.pxi @@ -139,25 +139,6 @@ cdef class Conditional(PolicySymbol): except TypeError: return str(self) == str(other) - def __deepcopy__(self, memo): - # shallow copy as all of the members are immutable - newobj = Conditional.factory(self.policy, self.handle) - memo[id(self)] = newobj - return newobj - - def __getstate__(self): - return (self.policy, self._pickle()) - - def __setstate__(self, state): - self.policy = state[0] - self._unpickle(state[1]) - - cdef bytes _pickle(self): - return (self.handle) - - cdef _unpickle(self, bytes handle): - memcpy(&self.handle, handle, sizeof(sepol.cond_node_t *)) - def _eq(self, Conditional other): """Low-level equality check (C pointers).""" return self.handle == other.handle