- Timestamp:
- Aug 7, 2022, 3:02:24 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/7dtd-server-fixes/src/JSON/JSONArray.cs
r351 r391 3 3 4 4 namespace AllocsFixes.JSON { 5 public class J SONArray : JSONNode {6 private readonly List<J SONNode> nodes = new List<JSONNode> ();5 public class JsonArray : JsonNode { 6 private readonly List<JsonNode> nodes = new List<JsonNode> (); 7 7 8 public J SONNode this [int _index] {9 get { return nodes [_index]; }10 set { nodes [_index] = value; }8 public JsonNode this [int _index] { 9 get => nodes [_index]; 10 set => nodes [_index] = value; 11 11 } 12 12 13 public int Count { 14 get { return nodes.Count; } 15 } 13 public int Count => nodes.Count; 16 14 17 public void Add (J SONNode _node) {15 public void Add (JsonNode _node) { 18 16 nodes.Add (_node); 19 17 } … … 25 23 } 26 24 27 foreach (J SONNode n in nodes) {25 foreach (JsonNode n in nodes) { 28 26 if (_prettyPrint) { 29 27 _stringBuilder.Append (new string ('\t', _currentLevel + 1)); … … 48 46 } 49 47 50 public static J SONArray Parse (string _json, ref int _offset) {48 public static JsonArray Parse (string _json, ref int _offset) { 51 49 //Log.Out ("ParseArray enter (" + offset + ")"); 52 J SONArray arr = new JSONArray ();50 JsonArray arr = new JsonArray (); 53 51 54 52 bool nextElemAllowed = true; … … 63 61 _offset++; 64 62 } else { 65 throw new MalformedJ SONException (63 throw new MalformedJsonException ( 66 64 "Could not parse array, found a comma without a value first"); 67 65 }
Note:
See TracChangeset
for help on using the changeset viewer.