From e59305ec874b02e7ac5def7174d4f75fbba10dc6 Mon Sep 17 00:00:00 2001 From: Alex Sergeyev Date: Thu, 11 Sep 2014 21:20:17 -0400 Subject: [PATCH] Fixed panic calls to be similar to others in library --- idn/punycode.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/idn/punycode.go b/idn/punycode.go index 8b801f9b..69368738 100644 --- a/idn/punycode.go +++ b/idn/punycode.go @@ -49,7 +49,7 @@ func digitval(code rune) rune { case code >= '0' && code <= '9': return code - '0' + 26 } - panic("never happens") + panic("dns: not reached") } // lettercode finds BASE36 byte (a-z0-9) based on calculated number. @@ -60,7 +60,7 @@ func lettercode(digit rune) rune { case digit >= 26 && digit <= 36: return digit - 26 + '0' } - panic("never happens") + panic("dns: not reached") } // adapt calculates next bias to be used for next iteration delta @@ -73,9 +73,6 @@ func adapt(delta rune, numpoints rune, firsttime bool) rune { var k rune for delta = delta + delta/numpoints; delta > (_BASE-_MIN)*_MAX/2; k += _BASE { - if _BASE <= _MIN { - panic("1") - } delta /= _BASE - _MIN }