Skip to content

Commit

Permalink
Formatting cleanup, removed Debug reference in SAIS
Browse files Browse the repository at this point in the history
  • Loading branch information
jzebedee committed Nov 14, 2014
1 parent e145c45 commit 5a11d1a
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions deltaq/SAIS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;

namespace deltaq
Expand Down Expand Up @@ -156,7 +155,7 @@ private static int LMS_post_proc(IList<int> T, IList<int> sa, int n, int m)

if (i < m)
{
for (j = i, ++i;; ++i)
for (j = i, ++i; ; ++i)
{
if ((p = sa[i]) < 0)
{
Expand All @@ -178,7 +177,7 @@ private static int LMS_post_proc(IList<int> T, IList<int> sa, int n, int m)
{
c1 = c0;
} while ((0 <= --i) && ((c0 = T[i]) >= c1));
for (; 0 <= i;)
for (; 0 <= i; )
{
do
{
Expand Down Expand Up @@ -306,10 +305,10 @@ private static void sais_main(IList<int> T, int[] sa, int fs, int n, int k)
c = sa.Slice(n + fs - k, sa.Length - (n + fs - k));
if (k <= (fs - k))
{
b = sa.Slice(n + fs - k*2, sa.Length - (n + fs - k*2));
b = sa.Slice(n + fs - k * 2, sa.Length - (n + fs - k * 2));
flags = 0;
}
else if (k <= (MinBucketSize*4))
else if (k <= (MinBucketSize * 4))
{
b = new int[k];
flags = 2;
Expand Down Expand Up @@ -345,7 +344,7 @@ sort all the LMS-substrings */
c1 = c0;
} while ((0 <= --i) && ((c0 = T[i]) >= c1));

for (; 0 <= i;)
for (; 0 <= i; )
{
do
{
Expand Down Expand Up @@ -394,7 +393,7 @@ sort all the LMS-substrings */
{
b = null;
}
int newfs = (n + fs) - (m*2);
int newfs = (n + fs) - (m * 2);
if ((flags & (1 | 4 | 8)) == 0)
{
if ((k + name) <= newfs)
Expand All @@ -408,7 +407,7 @@ sort all the LMS-substrings */
}

// ReSharper disable once LoopVariableIsNeverChangedInsideLoop
for (i = m + (n >> 1) - 1, j = m*2 + newfs - 1; m <= i; --i)
for (i = m + (n >> 1) - 1, j = m * 2 + newfs - 1; m <= i; --i)
{
if (sa[i] != 0)
{
Expand All @@ -419,14 +418,14 @@ sort all the LMS-substrings */
sais_main(sa.Slice(m + newfs, sa.Length - (m + newfs)), sa, newfs, m, name);

i = n - 1;
j = m*2 - 1;
j = m * 2 - 1;
c0 = T[n - 1];
do
{
c1 = c0;
} while ((0 <= --i) && ((c0 = T[i]) >= c1));

for (; 0 <= i;)
for (; 0 <= i; )
{
do
{
Expand Down Expand Up @@ -472,7 +471,7 @@ sort all the LMS-substrings */
c1 = T[p];
do
{
Debug.Assert(b != null, "b != null");
// ReSharper disable once PossibleNullReferenceException
int q = b[c0 = c1];

// ReSharper disable once LoopVariableIsNeverChangedInsideLoop
Expand Down Expand Up @@ -556,7 +555,7 @@ public void RemoveAt(int index)
public int this[int index]
{
get { return _buffer[index]; }
set { _buffer[index] = (byte) value; }
set { _buffer[index] = (byte)value; }
}

public void Add(int item)
Expand Down

0 comments on commit 5a11d1a

Please sign in to comment.