Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -20,57 +20,56 @@
|
|||
|
||||
namespace Server
|
||||
{
|
||||
public class KeywordList
|
||||
{
|
||||
private int[] m_Keywords;
|
||||
public class KeywordList
|
||||
{
|
||||
private static int[] m_EmptyInts = new int[0];
|
||||
private int[] m_Keywords;
|
||||
|
||||
public KeywordList()
|
||||
{
|
||||
m_Keywords = new int[8];
|
||||
Count = 0;
|
||||
}
|
||||
public KeywordList()
|
||||
{
|
||||
m_Keywords = new int[8];
|
||||
Count = 0;
|
||||
}
|
||||
|
||||
public int Count { get; private set; }
|
||||
public int Count{ get; private set; }
|
||||
|
||||
public bool Contains( int keyword )
|
||||
{
|
||||
bool contains = false;
|
||||
public bool Contains(int keyword)
|
||||
{
|
||||
bool contains = false;
|
||||
|
||||
for ( int i = 0; !contains && i < Count; ++i )
|
||||
contains = ( keyword == m_Keywords[i] );
|
||||
for (int i = 0; !contains && i < Count; ++i)
|
||||
contains = keyword == m_Keywords[i];
|
||||
|
||||
return contains;
|
||||
}
|
||||
return contains;
|
||||
}
|
||||
|
||||
public void Add( int keyword )
|
||||
{
|
||||
if ( (Count + 1) > m_Keywords.Length )
|
||||
{
|
||||
int[] old = m_Keywords;
|
||||
m_Keywords = new int[old.Length * 2];
|
||||
public void Add(int keyword)
|
||||
{
|
||||
if (Count + 1 > m_Keywords.Length)
|
||||
{
|
||||
int[] old = m_Keywords;
|
||||
m_Keywords = new int[old.Length * 2];
|
||||
|
||||
for ( int i = 0; i < old.Length; ++i )
|
||||
m_Keywords[i] = old[i];
|
||||
}
|
||||
for (int i = 0; i < old.Length; ++i)
|
||||
m_Keywords[i] = old[i];
|
||||
}
|
||||
|
||||
m_Keywords[Count++] = keyword;
|
||||
}
|
||||
m_Keywords[Count++] = keyword;
|
||||
}
|
||||
|
||||
private static int[] m_EmptyInts = new int[0];
|
||||
public int[] ToArray()
|
||||
{
|
||||
if (Count == 0)
|
||||
return m_EmptyInts;
|
||||
|
||||
public int[] ToArray()
|
||||
{
|
||||
if ( Count == 0 )
|
||||
return m_EmptyInts;
|
||||
int[] keywords = new int[Count];
|
||||
|
||||
int[] keywords = new int[Count];
|
||||
for (int i = 0; i < Count; ++i)
|
||||
keywords[i] = m_Keywords[i];
|
||||
|
||||
for ( int i = 0; i < Count; ++i )
|
||||
keywords[i] = m_Keywords[i];
|
||||
Count = 0;
|
||||
|
||||
Count = 0;
|
||||
|
||||
return keywords;
|
||||
}
|
||||
}
|
||||
return keywords;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue