summaryrefslogtreecommitdiff
path: root/lib.go
diff options
context:
space:
mode:
authorthree <three3q@qq.com>2021-08-13 01:32:44 +0800
committerGitHub <noreply@github.com>2021-08-13 01:32:44 +0800
commitf6f14f507ee1adf4883cb1b12f27932a63afb286 (patch)
tree36128e53dc1b54f555bdd944829b1a4eb270f053 /lib.go
parent61d0ed1ff26fbe47b4bfdc6adbc6db09743beb3a (diff)
Speed up merge cells
Diffstat (limited to 'lib.go')
-rw-r--r--lib.go5
1 files changed, 2 insertions, 3 deletions
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)