File tree Expand file tree Collapse file tree 1 file changed +0
-39
lines changed
Expand file tree Collapse file tree 1 file changed +0
-39
lines changed Original file line number Diff line number Diff line change @@ -91,43 +91,4 @@ public readonly override int GetHashCode()
9191 return ! ( left == right ) ;
9292 }
9393 }
94-
95- [ Serializable ]
96- public struct BitArray256
97- {
98- [ SerializeField ]
99- ulong bits0 , bit1 , bits2 , bits3 ;
100-
101- public void SetBit ( int index , bool value )
102- {
103- if ( ( uint ) index > 255 )
104- {
105- throw new ArgumentOutOfRangeException ( nameof ( index ) , "Index must be between 0 and 255." ) ;
106- }
107- ref var targetBits = ref Unsafe . Add ( ref bits0 , index >> 6 ) ;
108- ulong mask = 1UL << ( index & 63 ) ;
109- if ( value )
110- {
111- targetBits |= mask ;
112- }
113- else
114- {
115- targetBits &= ~ mask ;
116- }
117- }
118- public bool IsSet ( int index )
119- {
120- if ( ( uint ) index > 255 )
121- {
122- throw new ArgumentOutOfRangeException ( nameof ( index ) , "Index must be between 0 and 255." ) ;
123- }
124- ref var targetBits = ref Unsafe . Add ( ref bits0 , index >> 6 ) ;
125- ulong mask = 1UL << ( index & 63 ) ;
126- return ( targetBits & mask ) != 0 ;
127- }
128-
129- public void Clear ( ) => this = default ;
130- }
13194}
132-
133-
You can’t perform that action at this time.
0 commit comments