Changeset 253 for binary-improvements/MapRendering/Web/LogBuffer.cs
- Timestamp:
- Dec 12, 2015, 4:08:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/Web/LogBuffer.cs
r250 r253 8 8 { 9 9 public class LogBuffer { 10 private const int MAX_ENTRIES = 50000;10 private const int MAX_ENTRIES = 30; 11 11 private static LogBuffer instance; 12 12 … … 92 92 } 93 93 94 public List<LogEntry> GetRange (ref int _start, refint _end) {94 public List<LogEntry> GetRange (ref int _start, int _count, out int _end) { 95 95 lock (logEntries) { 96 if (_end < 0) { 97 _end = listOffset + logEntries.Count; 96 if (_count < 1) { 97 _end = _start; 98 return new List<LogEntry> (); 98 99 } 99 100 … … 107 108 } 108 109 109 if (_end < _start) { 110 Log.Error ("GetRange: invalid end {0} (listOffset: {1}, count: {2})", _end, listOffset, logEntries.Count); 111 return null; 112 } 113 114 if (_end >= listOffset + logEntries.Count) { 115 _end = listOffset + logEntries.Count - 1; 116 } 117 118 return logEntries.GetRange (_start - listOffset, _end - _start + 1); 110 _end = _start + _count; 111 return logEntries.GetRange (_start - listOffset, _count); 119 112 } 120 113 }
Note:
See TracChangeset
for help on using the changeset viewer.