diff --git a/internal/pkg/bifs/arithmetic.go b/internal/pkg/bifs/arithmetic.go index 2ebc8b527..45fc41390 100644 --- a/internal/pkg/bifs/arithmetic.go +++ b/internal/pkg/bifs/arithmetic.go @@ -278,14 +278,6 @@ func divide_n_ii(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { } else { return mlrval.FromFloat(float64(a) / float64(b)) } - - c := float64(a) * float64(b) - - if math.Abs(c) > 9223372036854774784.0 { - return mlrval.FromFloat(c) - } else { - return mlrval.FromInt(a * b) - } } func divide_f_if(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval { diff --git a/internal/pkg/bifs/collections.go b/internal/pkg/bifs/collections.go index 2a1341cb1..2e7c5b426 100644 --- a/internal/pkg/bifs/collections.go +++ b/internal/pkg/bifs/collections.go @@ -15,18 +15,14 @@ func BIF_length(input1 *mlrval.Mlrval) *mlrval.Mlrval { switch input1.Type() { case mlrval.MT_ERROR: return mlrval.FromInt(0) - break case mlrval.MT_ABSENT: return mlrval.FromInt(0) - break case mlrval.MT_ARRAY: arrayval := input1.AcquireArrayValue() return mlrval.FromInt(int64(len(arrayval))) - break case mlrval.MT_MAP: mapval := input1.AcquireMapValue() return mlrval.FromInt(mapval.FieldCount) - break } return mlrval.FromInt(1) } diff --git a/internal/pkg/bifs/relative_time.go b/internal/pkg/bifs/relative_time.go index eb75c938c..33b41be85 100644 --- a/internal/pkg/bifs/relative_time.go +++ b/internal/pkg/bifs/relative_time.go @@ -179,8 +179,6 @@ func BIF_sec2dhms(input1 *mlrval.Mlrval) *mlrval.Mlrval { fmt.Sprintf("%ds", s), ) } - - return mlrval.ERROR } func BIF_sec2hms(input1 *mlrval.Mlrval) *mlrval.Mlrval { @@ -202,8 +200,6 @@ func BIF_sec2hms(input1 *mlrval.Mlrval) *mlrval.Mlrval { return mlrval.FromString( fmt.Sprintf("%s%02d:%02d:%02d", sign, h, m, s), ) - - return mlrval.ERROR } func BIF_fsec2dhms(input1 *mlrval.Mlrval) *mlrval.Mlrval { @@ -285,8 +281,6 @@ func BIF_fsec2hms(input1 *mlrval.Mlrval) *mlrval.Mlrval { fmt.Sprintf("%s%02d:%02d:%.6f", sign, h, m, float64(s)+fractional), ) } - - return mlrval.ERROR } // Helper function diff --git a/internal/pkg/lib/file_readers.go b/internal/pkg/lib/file_readers.go index ffd38762c..fa42688ef 100644 --- a/internal/pkg/lib/file_readers.go +++ b/internal/pkg/lib/file_readers.go @@ -156,13 +156,10 @@ func openEncodedHandleForRead( switch encoding { case FileInputEncodingBzip2: return NewBZip2ReadCloser(handle), nil - break case FileInputEncodingGzip: return gzip.NewReader(handle) - break case FileInputEncodingZlib: return zlib.NewReader(handle) - break } InternalCodingErrorIf(encoding != FileInputEncodingDefault) diff --git a/internal/pkg/lib/logger.go b/internal/pkg/lib/logger.go index be0973020..31876cb91 100644 --- a/internal/pkg/lib/logger.go +++ b/internal/pkg/lib/logger.go @@ -91,7 +91,6 @@ func InternalCodingErrorPanic(message string) { ), ) } - os.Exit(1) } // WhereAreWe shows a stack trace from the current callsite. diff --git a/internal/pkg/lib/ordered_map.go b/internal/pkg/lib/ordered_map.go index 5f9aa5b1c..093c1ca84 100644 --- a/internal/pkg/lib/ordered_map.go +++ b/internal/pkg/lib/ordered_map.go @@ -97,7 +97,6 @@ func (omap *OrderedMap) Get(key string) interface{} { } else { return pe.Value } - return nil } // The Get is sufficient for pointer values -- the caller can check if the @@ -110,7 +109,6 @@ func (omap *OrderedMap) GetWithCheck(key string) (interface{}, bool) { } else { return pe.Value, true } - return nil, false } // ---------------------------------------------------------------- diff --git a/internal/pkg/mlrval/mlrmap_accessors.go b/internal/pkg/mlrval/mlrmap_accessors.go index 25f586516..6bab28bc0 100644 --- a/internal/pkg/mlrval/mlrmap_accessors.go +++ b/internal/pkg/mlrval/mlrmap_accessors.go @@ -24,7 +24,6 @@ func (mlrmap *Mlrmap) Get(key string) *Mlrval { } else { return pe.Value } - return nil } // PutReference copies the key but not the value. This is not safe for DSL use, diff --git a/internal/pkg/mlrval/mlrval_collections.go b/internal/pkg/mlrval/mlrval_collections.go index 4a335ac15..f6103f611 100644 --- a/internal/pkg/mlrval/mlrval_collections.go +++ b/internal/pkg/mlrval/mlrval_collections.go @@ -310,8 +310,6 @@ func (mv *Mlrval) PutIndexed(indices []*Mlrval, rvalue *Mlrval) error { ) } } - - return nil } // ---------------------------------------------------------------- @@ -432,10 +430,7 @@ func putIndexedOnArray( zindex := mindex.intval - 1 return (*baseArray)[zindex].PutIndexed(indices[1:], rvalue) } - } - - return nil } // ---------------------------------------------------------------- diff --git a/internal/pkg/mlrval/mlrval_json.go b/internal/pkg/mlrval/mlrval_json.go index 021e678ef..f3982edcc 100644 --- a/internal/pkg/mlrval/mlrval_json.go +++ b/internal/pkg/mlrval/mlrval_json.go @@ -253,8 +253,6 @@ func MlrvalDecodeFromJSON(decoder *json.Decoder) ( return mv, false, nil } - - return nil, false, fmt.Errorf("mlr: unimplemented") } // ================================================================