aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers/ExtensionRegistryLite.cs
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-07-14 13:06:22 -0500
committerrogerk <devnull@localhost>2011-07-14 13:06:22 -0500
commit74c5e0c3762939fbf5988daf6f97c5d9c97ef4f5 (patch)
tree642a1a002907d3291c88e7933cfda87a6704beee /src/ProtocolBuffers/ExtensionRegistryLite.cs
parentafff2c655c1d39b8f6cd7756c190a559d15134d1 (diff)
downloadprotobuf-74c5e0c3762939fbf5988daf6f97c5d9c97ef4f5.tar.gz
protobuf-74c5e0c3762939fbf5988daf6f97c5d9c97ef4f5.tar.bz2
protobuf-74c5e0c3762939fbf5988daf6f97c5d9c97ef4f5.zip
Reformatted to include braces
Diffstat (limited to 'src/ProtocolBuffers/ExtensionRegistryLite.cs')
-rw-r--r--src/ProtocolBuffers/ExtensionRegistryLite.cs26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/ProtocolBuffers/ExtensionRegistryLite.cs b/src/ProtocolBuffers/ExtensionRegistryLite.cs
index 91a0ce29..df0a7b25 100644
--- a/src/ProtocolBuffers/ExtensionRegistryLite.cs
+++ b/src/ProtocolBuffers/ExtensionRegistryLite.cs
@@ -34,9 +34,8 @@
#endregion
-using System.Collections.Generic;
using System;
-using Google.ProtocolBuffers.Descriptors;
+using System.Collections.Generic;
namespace Google.ProtocolBuffers
{
@@ -93,8 +92,13 @@ namespace Google.ProtocolBuffers
/// </remarks>
public sealed partial class ExtensionRegistry
{
- class ExtensionByNameMap : Dictionary<object, Dictionary<string, IGeneratedExtensionLite>> { }
- class ExtensionByIdMap : Dictionary<ExtensionIntPair, IGeneratedExtensionLite> { }
+ private class ExtensionByNameMap : Dictionary<object, Dictionary<string, IGeneratedExtensionLite>>
+ {
+ }
+
+ private class ExtensionByIdMap : Dictionary<ExtensionIntPair, IGeneratedExtensionLite>
+ {
+ }
private static readonly ExtensionRegistry empty = new ExtensionRegistry(
new ExtensionByNameMap(),
@@ -149,14 +153,18 @@ namespace Google.ProtocolBuffers
}
public IGeneratedExtensionLite FindByName(IMessageLite defaultInstanceOfType, string fieldName)
- { return FindExtensionByName(defaultInstanceOfType, fieldName); }
+ {
+ return FindExtensionByName(defaultInstanceOfType, fieldName);
+ }
- IGeneratedExtensionLite FindExtensionByName(object forwhat, string fieldName)
+ private IGeneratedExtensionLite FindExtensionByName(object forwhat, string fieldName)
{
IGeneratedExtensionLite extension = null;
Dictionary<string, IGeneratedExtensionLite> map;
if (extensionsByName.TryGetValue(forwhat, out map) && map.TryGetValue(fieldName, out extension))
+ {
return extension;
+ }
return null;
}
@@ -173,7 +181,9 @@ namespace Google.ProtocolBuffers
Dictionary<string, IGeneratedExtensionLite> map;
if (!extensionsByName.TryGetValue(extension.ContainingType, out map))
+ {
extensionsByName.Add(extension.ContainingType, map = new Dictionary<string, IGeneratedExtensionLite>());
+ }
map[extension.Descriptor.Name] = extension;
map[extension.Descriptor.FullName] = extension;
}
@@ -195,7 +205,7 @@ namespace Google.ProtocolBuffers
public override int GetHashCode()
{
- return msgType.GetHashCode() * ((1 << 16) - 1) + number;
+ return msgType.GetHashCode()*((1 << 16) - 1) + number;
}
public override bool Equals(object obj)
@@ -204,7 +214,7 @@ namespace Google.ProtocolBuffers
{
return false;
}
- return Equals((ExtensionIntPair)obj);
+ return Equals((ExtensionIntPair) obj);
}
public bool Equals(ExtensionIntPair other)