-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAlgorithm.sln.DotSettings
More file actions
29 lines (27 loc) · 1.1 KB
/
Algorithm.sln.DotSettings
File metadata and controls
29 lines (27 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=4E74D5B3909029439D9863EAC32D7F36/Text/@EntryValue">public static unsafe $TYPE$ $NAME$(ArraySegment<$TYPE$> source)
{
const int step = $STEP$
fixed ($TYPE$* pSource = source.Array)
unchecked
{
int tail = source.Count % step;
$TYPE$* b = ($TYPE$*)(pSource + source.Offset);
$TYPE$* e = ($TYPE$*)(pSource + source.Offset + source.Count - tail);
while (b < e)
{
//use *(b)
//use *(b+1)
//...
b += $STEP$;
}
b = e;
e = ($TYPE$*)(pSource + source.Offset + source.Count);
while (b < e)
{
//use *(b)
b += 1;
}
}
return result;
}</s:String></wpf:ResourceDictionary>