File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,7 +178,6 @@ public long DecodeSingleLong(string hash)
178178 return number switch
179179 {
180180 - 1 => throw new NoResultException ( "The hash provided yielded no result." ) ,
181- - 2 => throw new MultipleResultsException ( "The hash provided yielded more than one result." ) ,
182181 _ => number ,
183182 } ;
184183 }
@@ -206,7 +205,6 @@ public virtual int DecodeSingle(string hash)
206205 return number switch
207206 {
208207 - 1 => throw new NoResultException ( "The hash provided yielded no result." ) ,
209- - 2 => throw new MultipleResultsException ( "The hash provided yielded more than one result." ) ,
210208 _ => ( int ) number ,
211209 } ;
212210 }
@@ -418,11 +416,6 @@ private long GetNumberFrom(string hash)
418416
419417 var hashBuffer = hashBreakdown . Slice ( 1 ) ;
420418
421- var indexOfSep = hashBuffer . IndexOfAny ( _seps ) ;
422-
423- if ( indexOfSep != - 1 )
424- return - 2 ;
425-
426419 Span < char > alphabet = _alphabet . Length < 512 ? stackalloc char [ _alphabet . Length ] : new char [ _alphabet . Length ] ;
427420 _alphabet . CopyTo ( alphabet ) ;
428421
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public void SingleInt_DecodesSingleNumber()
5858 _hashids . DecodeSingle ( "yj8" ) . Should ( ) . Be ( 303 ) ;
5959
6060 Assert . Throws < NoResultException > ( ( ) => _hashids . DecodeSingle ( string . Empty ) ) ;
61- Assert . Throws < MultipleResultsException > ( ( ) => _hashids . DecodeSingle ( "aBMswoO2UB3Sj" ) ) ;
61+ Assert . Throws < NoResultException > ( ( ) => _hashids . DecodeSingle ( "aBMswoO2UB3Sj" ) ) ;
6262 }
6363
6464 [ Fact ]
@@ -120,7 +120,7 @@ public void SingleLong_DecodesSingleNumber()
120120 _hashids . DecodeSingleLong ( "jvNx4BjM5KYjv" ) . Should ( ) . Be ( long . MaxValue ) ;
121121
122122 Assert . Throws < NoResultException > ( ( ) => _hashids . DecodeSingleLong ( string . Empty ) ) ;
123- Assert . Throws < MultipleResultsException > ( ( ) => _hashids . DecodeSingleLong ( "6gH3kPY7MJ9zjM3" ) ) ;
123+ Assert . Throws < NoResultException > ( ( ) => _hashids . DecodeSingleLong ( "6gH3kPY7MJ9zjM3" ) ) ;
124124 }
125125
126126 [ Fact ]
You can’t perform that action at this time.
0 commit comments