Skip to content

Remove dead code for tagVARIANT #787

Open
@moi15moi

Description

@moi15moi

I was investigating the memory leak in #775 and came across this piece of code:

elif isinstance(value, int):
u = self._
# try VT_I4 first.
u.VT_I4 = value
if u.VT_I4 == value:
# it did work.
self.vt = VT_I4
return
# try VT_UI4 next.
if value >= 0:
u.VT_UI4 = value
if u.VT_UI4 == value:
# did work.
self.vt = VT_UI4
return
# try VT_I8 next.
if value >= 0:
u.VT_I8 = value
if u.VT_I8 == value:
# did work.
self.vt = VT_I8
return
# try VT_UI8 next.
if value >= 0:
u.VT_UI8 = value
if u.VT_UI8 == value:
# did work.
self.vt = VT_UI8
return
# VT_R8 is last resort.
self.vt = VT_R8
u.VT_R8 = float(value)

It appears to be dead code since there's already an elif handling int:

elif isinstance(value, (int, c_int)):
self.vt = VT_I4
self._.VT_I4 = value

Could this be removed?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions