@@ -840,13 +840,9 @@ type formulaFuncs struct {
840840// ZTEST
841841func (f *File) CalcCellValue(sheet, cell string, opts ...Options) (result string, err error) {
842842 cacheKey := fmt.Sprintf("%s!%s", sheet, cell)
843- f.calcCacheMu.RLock()
844843 if cachedResult, found := f.calcCache.Load(cacheKey); found {
845- f.calcCacheMu.RUnlock()
846844 return cachedResult.(string), nil
847845 }
848- f.calcCacheMu.RUnlock()
849-
850846 options := f.getOptions(opts...)
851847 var (
852848 rawCellValue = options.RawCellValue
@@ -870,27 +866,21 @@ func (f *File) CalcCellValue(sheet, cell string, opts ...Options) (result string
870866 if precision > 15 {
871867 result, err = f.formattedValue(&xlsxC{S: styleIdx, V: strings.ToUpper(strconv.FormatFloat(decimal, 'G', 15, 64))}, rawCellValue, CellTypeNumber)
872868 if err == nil {
873- f.calcCacheMu.Lock()
874869 f.calcCache.Store(cacheKey, result)
875- f.calcCacheMu.Unlock()
876870 }
877871 return
878872 }
879873 if !strings.HasPrefix(result, "0") {
880874 result, err = f.formattedValue(&xlsxC{S: styleIdx, V: strings.ToUpper(strconv.FormatFloat(decimal, 'f', -1, 64))}, rawCellValue, CellTypeNumber)
881875 }
882876 if err == nil {
883- f.calcCacheMu.Lock()
884877 f.calcCache.Store(cacheKey, result)
885- f.calcCacheMu.Unlock()
886878 }
887879 return
888880 }
889881 result, err = f.formattedValue(&xlsxC{S: styleIdx, V: token.Value()}, rawCellValue, CellTypeInlineString)
890882 if err == nil {
891- f.calcCacheMu.Lock()
892883 f.calcCache.Store(cacheKey, result)
893- f.calcCacheMu.Unlock()
894884 }
895885 return
896886}
@@ -1335,13 +1325,6 @@ func calcDiv(rOpd, lOpd formulaArg, opdStack *Stack) error {
13351325 return nil
13361326}
13371327
1338- // clearCalcCache clear all calculation cache.
1339- func (f *File) clearCalcCache() {
1340- f.calcCacheMu.Lock()
1341- f.calcCache.Clear()
1342- f.calcCacheMu.Unlock()
1343- }
1344-
13451328// calculate evaluate basic arithmetic operations.
13461329func calculate(opdStack *Stack, opt efp.Token) error {
13471330 if opt.TValue == "-" && opt.TType == efp.TokenTypeOperatorPrefix {
0 commit comments