Skip to content

Commit

Permalink
restore globals
Browse files Browse the repository at this point in the history
  • Loading branch information
mobiusklein committed Jan 14, 2025
1 parent 586efd4 commit f3ac30a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/glypy/_c/structure/glycan_composition.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ from glypy.composition import formula

from glypy._c.utils cimport _prepare_glycan_composition_string

# cdef CComposition WATER = CComposition("H2O")
# cdef object ZERO = 0
cdef CComposition WATER = CComposition("H2O")
cdef object ZERO = 0


cdef class _CompositionBase(dict):
Expand All @@ -19,7 +19,7 @@ cdef class _CompositionBase(dict):
cdef _CompositionBase inst = cls.__new__(cls)
inst._mass = None
inst._reducing_end = None
inst._composition_offset = CComposition._create(CComposition("H2O"))
inst._composition_offset = CComposition._create(WATER)
return inst

cpdef object _getitem_fast(self, object key):
Expand All @@ -28,7 +28,7 @@ cdef class _CompositionBase(dict):

ptmp = PyDict_GetItem(self, key)
if ptmp == NULL:
return PyInt_FromLong(0)
return ZERO
return <object>ptmp

cpdef object _setitem_fast(self, object key, object value):
Expand Down

0 comments on commit f3ac30a

Please sign in to comment.