LwipMibCompiler: MibTree: Adapt coding style to the rest of the C# project

This commit is contained in:
Dirk Ziegelmeier 2016-03-14 12:13:05 +01:00
parent 1d7996dc47
commit dc98e31e4d

View File

@ -38,7 +38,7 @@ namespace Lextm.SharpSnmpLib.Mib
} }
} }
FilterRealRoots (_root, entities); FilterRealRoots (entities);
foreach (MibTreeNode mibTreeNode in _root) foreach (MibTreeNode mibTreeNode in _root)
{ {
@ -68,19 +68,23 @@ namespace Lextm.SharpSnmpLib.Mib
get { return _root; } get { return _root; }
} }
private bool EntityExists(IList<IEntity> entities, string name) { private bool EntityExists(IList<IEntity> entities, string name)
foreach(IEntity entity in entities) { {
if (entity.Name == name) { foreach(IEntity entity in entities)
{
if (entity.Name == name)
{
return true; return true;
} }
} }
return false; return false;
} }
private void FilterRealRoots(IList<MibTreeNode> root, IList<IEntity> entities) private void FilterRealRoots(IList<IEntity> entities)
{ {
int i = 0; int i = 0;
while (i < _root.Count) { while (i < _root.Count)
{
if (EntityExists(entities, _root[i].Entity.Parent)) if (EntityExists(entities, _root[i].Entity.Parent))
{ {
_root.RemoveAt(i); _root.RemoveAt(i);