From 74c5e0c3762939fbf5988daf6f97c5d9c97ef4f5 Mon Sep 17 00:00:00 2001 From: csharptest Date: Thu, 14 Jul 2011 13:06:22 -0500 Subject: Reformatted to include braces --- src/ProtocolBuffers/Collections/PopsicleList.cs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/ProtocolBuffers/Collections') 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(); + } items.AddRange(collection); } @@ -151,14 +162,18 @@ namespace Google.ProtocolBuffers.Collections throw new NotSupportedException("List is read-only"); } if (items == null) + { items = new List(); + } } IEnumerable ICastArray.CastArray() { if (items == null) + { return new TItemType[0]; - return (TItemType[])(object)items.ToArray(); + } + return (TItemType[]) (object) items.ToArray(); } } } \ No newline at end of file -- cgit v1.2.3