summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-05-25 00:20:51 -0400
committerJesse Luehrs <doy@tozt.net>2016-05-25 00:20:51 -0400
commitb4b720e5322df26689ccc684a78dcb5db924da94 (patch)
tree9fcf12b8fbdff8df3f834e4f4e3cebfb16831c6d
parentefac4c2315118e4e8b0f783d41b4fdb6e0255440 (diff)
downloadspreadsheet-parsexlsx-b4b720e5322df26689ccc684a78dcb5db924da94.tar.gz
spreadsheet-parsexlsx-b4b720e5322df26689ccc684a78dcb5db924da94.zip
avoid calling first_child twice here
-rw-r--r--lib/Spreadsheet/ParseXLSX.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm
index bea6b98..a66c4d8 100644
--- a/lib/Spreadsheet/ParseXLSX.pm
+++ b/lib/Spreadsheet/ParseXLSX.pm
@@ -428,14 +428,15 @@ sub _parse_sheet {
$long_type = 'Date';
}
+ my $formula = $cell->first_child('s:f');
my $cell = Spreadsheet::ParseExcel::Cell->new(
Val => $val,
Type => $long_type,
Merged => $format->{Merged},
Format => $format,
FormatNo => $format_idx,
- ($cell->first_child('s:f')
- ? (Formula => $cell->first_child('s:f')->text)
+ ($formula
+ ? (Formula => $formula->text)
: ()),
Rich => $Rich,
);