Skip to content

Commit

Permalink
Fixed a few arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Nov 7, 2010
1 parent 787dbb5 commit 7538e7b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Browser/ModuleListPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ private void ActAddExecute(object sender, EventArgs e)
foreach (ListViewItem item in listView1.SelectedItems)
{
string name = item.Text.ToUpperInvariant();

// TODO: bad performance. improve later.
List<string> list = new List<string>(File.ReadAllLines(index));
if (list.Contains(name))
{
Expand All @@ -138,6 +140,8 @@ private void ActRemoveExecute(object sender, EventArgs e)
foreach (ListViewItem item in listView1.SelectedItems)
{
string name = item.Text.ToUpperInvariant();

// TODO: bad performance. improve later.
List<string> list = new List<string>(File.ReadAllLines(index));
if (!list.Contains(name))
{
Expand Down
3 changes: 1 addition & 2 deletions Compiler/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ private void ActCompileExecute(object sender, EventArgs e)
{
IDockContent content = dockPanel1.ActiveDocument;
DocumentPanel doc = (DocumentPanel)content;
List<string> fileList = new List<string>(1) { doc.FileName };
Compiler.Compile(fileList);
Compiler.Compile(new [] { doc.FileName });
}

private void ActCompileUpdate(object sender, EventArgs e)
Expand Down
1 change: 0 additions & 1 deletion SharpSnmpLib/GetRequestPdu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public GetRequestPdu(int requestId, ErrorCode errorStatus, int errorIndex, IList
ErrorIndex = new Integer32(errorIndex);
Variables = variables;
_varbindSection = Variable.Transform(variables);
////_raw = ByteTool.ParseItems(_sequenceNumber, _errorStatus, _errorIndex, _varbindSection);
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions SharpSnmpLib/Messaging/SnmpMessageExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ internal static Sequence PackMessage(VersionCode version, ISegment header, ISegm
throw new ArgumentNullException("privacy");
}

List<ISnmpData> collection = new List<ISnmpData>(4)
ISnmpData[] collection = new ISnmpData[4]
{
new Integer32((int)version),
header.GetData(version),
Expand Down Expand Up @@ -95,7 +95,7 @@ internal static Sequence PackMessage(VersionCode version, ISegment header, Secur
throw new ArgumentNullException("privacy");
}

List<ISnmpData> collection = new List<ISnmpData>(4)
ISnmpData[] collection = new ISnmpData[4]
{
new Integer32((int)version),
header.GetData(version),
Expand Down
1 change: 1 addition & 0 deletions SharpSnmpLib/Variable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ internal static IList<Variable> Transform(Sequence varbindSection)
/// <returns></returns>
internal static Sequence Transform(IList<Variable> variables)
{
// TODO: use IEnumerable instead of IList.
if (variables == null)
{
throw new ArgumentNullException("variables");
Expand Down

0 comments on commit 7538e7b

Please sign in to comment.