From ad9cda09cbc23eb0b51e5f2b78de014ff9a43b76 Mon Sep 17 00:00:00 2001 From: Deantwo Date: Tue, 10 Jul 2018 16:00:21 +0200 Subject: [PATCH] IndexOf fix --- Asterisk.2013/Asterisk.NET/Manager/ManagerReader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Asterisk.2013/Asterisk.NET/Manager/ManagerReader.cs b/Asterisk.2013/Asterisk.NET/Manager/ManagerReader.cs index 98cca81..2f33f40 100644 --- a/Asterisk.2013/Asterisk.NET/Manager/ManagerReader.cs +++ b/Asterisk.2013/Asterisk.NET/Manager/ManagerReader.cs @@ -133,7 +133,7 @@ namespace AsterNET.Manager // \n - because not all dev in Digium use \r\n // .Trim() kill \r lock (((ICollection) lineQueue).SyncRoot) - while (!string.IsNullOrEmpty(mrReader.lineBuffer) && (idx = mrReader.lineBuffer.IndexOf("\n")) >= 0) + while (!string.IsNullOrEmpty(mrReader.lineBuffer) && (idx = mrReader.lineBuffer.IndexOf('\n')) >= 0) { line = idx > 0 ? mrReader.lineBuffer.Substring(0, idx).Trim() : string.Empty; mrReader.lineBuffer = (idx + 1 < mrReader.lineBuffer.Length