aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers/Collections
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/Collections
parentafff2c655c1d39b8f6cd7756c190a559d15134d1 (diff)
downloadprotobuf-74c5e0c3762939fbf5988daf6f97c5d9c97ef4f5.tar.gz
protobuf-74c5e0c3762939fbf5988daf6f97c5d9c97ef4f5.tar.bz2
protobuf-74c5e0c3762939fbf5988daf6f97c5d9c97ef4f5.zip
Reformatted to include braces
Diffstat (limited to 'src/ProtocolBuffers/Collections')
-rw-r--r--src/ProtocolBuffers/Collections/PopsicleList.cs21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/ProtocolBuffers/Collections/PopsicleList.cs b/src/ProtocolBuffers/Collections/PopsicleList.cs
index 48161e82..6cabb448 100644
--- a/src/ProtocolBuffers/Collections/PopsicleList.cs
+++ b/src/ProtocolBuffers/Collections/PopsicleList.cs
@@ -30,8 +30,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
-using System.Collections.Generic;
using System.Collections;
+using System.Collections.Generic;
namespace Google.ProtocolBuffers.Collections
{
@@ -76,7 +76,14 @@ namespace Google.ProtocolBuffers.Collections
public T this[int index]
{
- get { if (items == null) throw new ArgumentOutOfRangeException(); return items[index]; }
+ get
+ {
+ if (items == null)
+ {
+ throw new ArgumentOutOfRangeException();
+ }
+ return items[index];
+ }
set
{
ValidateModification();
@@ -104,7 +111,9 @@ namespace Google.ProtocolBuffers.Collections
public void CopyTo(T[] array, int arrayIndex)
{
if (items != null)
+ {
items.CopyTo(array, arrayIndex);
+ }
}
public int Count
@@ -140,7 +149,9 @@ namespace Google.ProtocolBuffers.Collections
throw new NotSupportedException("List is read-only");
}
if (items == null)
+ {
items = new List<T>();
+ }
items.AddRange(collection);
}
@@ -151,14 +162,18 @@ namespace Google.ProtocolBuffers.Collections
throw new NotSupportedException("List is read-only");
}
if (items == null)
+ {
items = new List<T>();
+ }
}
IEnumerable<TItemType> ICastArray.CastArray<TItemType>()
{
if (items == null)
+ {
return new TItemType[0];
- return (TItemType[])(object)items.ToArray();
+ }
+ return (TItemType[]) (object) items.ToArray();
}
}
} \ No newline at end of file