From f6f14f507ee1adf4883cb1b12f27932a63afb286 Mon Sep 17 00:00:00 2001 From: three Date: Fri, 13 Aug 2021 01:32:44 +0800 Subject: Speed up merge cells --- lib.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib.go') diff --git a/lib.go b/lib.go index 7db14c4..912f738 100644 --- a/lib.go +++ b/lib.go @@ -221,12 +221,11 @@ func CoordinatesToCellName(col, row int, abs ...bool) (string, error) { // areaRefToCoordinates provides a function to convert area reference to a // pair of coordinates. -func (f *File) areaRefToCoordinates(ref string) ([]int, error) { +func areaRefToCoordinates(ref string) ([]int, error) { rng := strings.Split(strings.Replace(ref, "$", "", -1), ":") if len(rng) < 2 { return nil, ErrParameterInvalid } - return areaRangeToCoordinates(rng[0], rng[1]) } @@ -290,7 +289,7 @@ func (f *File) flatSqref(sqref string) (cells map[int][][]int, err error) { } cells[col] = append(cells[col], []int{col, row}) case 2: - if coordinates, err = f.areaRefToCoordinates(ref); err != nil { + if coordinates, err = areaRefToCoordinates(ref); err != nil { return } _ = sortCoordinates(coordinates) -- cgit v1.2.1