Declarations ​
pascal
function GetOptimalWrap(Max: Integer): TWrapProc; overload;
function GetOptimalWrap(Min, Max: Integer): TWrapProcEx; overload;Overload Details
Overload 1 ​
pascal
function GetOptimalWrap(Max: Integer): TWrapProc; overload;Returns optimal TWrapProc delegate for range [0..Max].
| Parameter | Type | Description |
|---|---|---|
Max | Integer | Upper range boundary. |
| Type | Description |
|---|---|
TWrapProc | Wrap procedure delegate (Wrap or WrapPow2). |
Overload 2 ​
pascal
function GetOptimalWrap(Min, Max: Integer): TWrapProcEx; overload;Returns optimal TWrapProcEx delegate for range [Min..Max].
| Parameter | Type | Description |
|---|---|---|
Min | Integer | Lower range boundary. |
Max | Integer | Upper range boundary. |
| Type | Description |
|---|---|
TWrapProcEx | Wrap procedure delegate (Wrap or WrapPow2). |
Description ​
GetOptimalWrap tests whether the length of the given range (Max + 1 or Max - Min + 1) is a power of two. If so, it returns the fast bitwise WrapPow2 function delegate; otherwise, it returns standard Wrap.