Skip to content

Commit

Permalink
Merge pull request #190 from Saibamen/optimize_CheckNumericOnly
Browse files Browse the repository at this point in the history
Optimize `CheckNumericOnly`
  • Loading branch information
barnhill authored Feb 4, 2024
2 parents e534f8e + f3dddc9 commit aed199d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions BarcodeStandard/BarcodeCommon.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace BarcodeStandard
{
Expand All @@ -17,15 +16,14 @@ protected void Error(string errorMessage)

internal static bool CheckNumericOnly(string data)
{
char c;
for (int i = 0; i < data.Length; i++)
foreach (var c in data)
{
c = data[i];
if (c < '0' && c > '9') return false;
}

return true;
}

internal static int GetAlignmentShiftAdjustment(Barcode barcode)
{
switch (barcode.Alignment)
Expand Down

0 comments on commit aed199d

Please sign in to comment.