From 8a69b58dfd2d2eb34eebf25eea14188bcb44bbc6 Mon Sep 17 00:00:00 2001 From: gschorer Date: Fri, 19 Dec 2014 11:24:02 -0500 Subject: [PATCH] Don't be stupid about array copying --- TimberWinR/Outputs/Redis.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/TimberWinR/Outputs/Redis.cs b/TimberWinR/Outputs/Redis.cs index 4528b10..3204c01 100644 --- a/TimberWinR/Outputs/Redis.cs +++ b/TimberWinR/Outputs/Redis.cs @@ -145,10 +145,7 @@ namespace TimberWinR.Outputs // then remove as many as necessary to get us under our limit if (_queueOverflowDiscardOldest) { - for (int i = 0; i <= (_jsonQueue.Count - _maxQueueSize); i++) - { - _jsonQueue.RemoveAt(0); - } + _jsonQueue.RemoveRange(0, (_jsonQueue.Count - _maxQueueSize) + 1); } // Otherwise we're in a "discard newest" mode, and this is the newest message, so just ignore it else