summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorochko <[email protected]>2011-12-16 17:46:20 +0900
committerochko <[email protected]>2011-12-16 17:48:08 +0900
commitb6b2cce467f37b6a3ebfea668604bb9ec2f00f09 (patch)
tree0e5fff81ae106a7cbf83297011a78c6eb40694d9 /lib
parent460e264aa954a141c622fcec2d4533a5b0f68ef3 (diff)
downloadcaxlsx-b6b2cce467f37b6a3ebfea668604bb9ec2f00f09.tar.gz
caxlsx-b6b2cce467f37b6a3ebfea668604bb9ec2f00f09.zip
Little performance improvement.
It doesn't need to do type detection if it is passed by options
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb
index 7e043438..0f06bd13 100644
--- a/lib/axlsx/workbook/worksheet/cell.rb
+++ b/lib/axlsx/workbook/worksheet/cell.rb
@@ -175,14 +175,14 @@ module Axlsx
# @option options [String] color an 8 letter rgb specification
# @option options [Symbol] scheme must be one of :none, major, :minor
def initialize(row, value="", options={})
- self.row=row
+ self.row=row
@styles = row.worksheet.workbook.styles
- @style = 0
- @type = cell_type_from_value(value)
@row.cells << self
options.each do |o|
self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
end
+ @style ||= 0
+ @type ||= cell_type_from_value(value)
@value = cast_value(value)
end