== string.Empty is .Lenght == 0

This commit is contained in:
UbitUmarov
2022-01-13 20:31:52 +00:00
parent 6595e3ae26
commit fbbcc1edd7
149 changed files with 261 additions and 264 deletions

View File

@@ -82,9 +82,9 @@ namespace OSHttpServer
// Verifies the parameter
if (cookie == null)
throw new ArgumentNullException("cookie");
if (cookie.Name == null || cookie.Name.Trim() == string.Empty)
if (cookie.Name == null || cookie.Name.Trim().Length == 0)
throw new ArgumentException("Name must be specified.");
if (cookie.Value == null || cookie.Value.Trim() == string.Empty)
if (cookie.Value == null || cookie.Value.Trim().Length == 0)
throw new ArgumentException("Content must be specified.");
if (_items.ContainsKey(cookie.Name))

View File

@@ -21,9 +21,9 @@ namespace OSHttpServer
// Verifies the parameter
if (cookie == null)
throw new ArgumentNullException("cookie");
if (cookie.Name == null || cookie.Name.Trim() == string.Empty)
if (cookie.Name == null || cookie.Name.Trim().Length == 0)
throw new ArgumentException("Name must be specified.");
if (cookie.Value == null || cookie.Value.Trim() == string.Empty)
if (cookie.Value == null || cookie.Value.Trim().Length == 0)
throw new ArgumentException("Content must be specified.");
if (_items.ContainsKey(cookie.Name))