Skip to content

Commit

Permalink
Optimize CheckNumericOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
Saibamen committed Feb 3, 2024
1 parent e534f8e commit f3dddc9
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 f3dddc9

Please sign in to comment.