Skip to content

Commit be93e1b

Browse files
committed
Cowboy Attempt #2
1 parent 25604b9 commit be93e1b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Rubberduck.VBEEditor/ComManagement/TypeLibs/Utility/VarDescExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Runtime.InteropServices.ComTypes;
1+
using System;
2+
using System.Runtime.InteropServices.ComTypes;
23

34
namespace Rubberduck.JunkDrawer.Hacks
45
{
@@ -28,11 +29,10 @@ public static bool IsValidVBAConstant(this VARDESC varDesc)
2829
// TODO: Move the function to a better home and avoid duplication of constants (see TypeInfoWrapper)
2930
const int _ourConstantsDispatchMemberIDRangeStart = unchecked((int)0xFEDC0000);
3031
const int _ourConstantsDispatchMemberIDRangeBitmaskCheck = unchecked((int)0xFFFF0000);
31-
const int _ourConstantsDispatchMemberIDIndexBitmask = unchecked((int)0x0000FFFF);
32-
if ((varDesc.memid & _ourConstantsDispatchMemberIDRangeBitmaskCheck) >= _ourConstantsDispatchMemberIDRangeStart)
33-
{
34-
return varDesc.varkind == VARKIND.VAR_STATIC && varDesc.desc.lpvarValue != 0;
35-
}
32+
33+
return (varDesc.memid & _ourConstantsDispatchMemberIDRangeBitmaskCheck) >= _ourConstantsDispatchMemberIDRangeStart
34+
&& varDesc.varkind == VARKIND.VAR_STATIC
35+
&& varDesc.desc.lpvarValue != IntPtr.Zero;
3636
}
3737
}
3838
}

0 commit comments

Comments
 (0)