We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 972e3ed commit c1fa024Copy full SHA for c1fa024
Orm/Xtensive.Orm/Tuples/Packed/PackedFieldAccessor.cs
@@ -5,6 +5,7 @@
5
// Created: 2013.01.22
6
7
using System;
8
+using System.Numerics;
9
10
namespace Xtensive.Tuples.Packed
11
{
@@ -144,15 +145,8 @@ internal abstract class ValueFieldAccessor : PackedFieldAccessor
144
145
146
public Type FieldType { get; protected set; }
147
- private static int GetRank(int bitSize)
148
- {
149
- var rank = 0;
150
- while ((bitSize >>= 1) > 0) {
151
- rank++;
152
- }
153
-
154
- return rank;
155
+ private static int GetRank(int bitSize) =>
+ BitOperations.Log2((uint)bitSize);
156
157
protected ValueFieldAccessor(int bitCount, byte index)
158
: base(GetRank(bitCount), index)
0 commit comments