Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize calls to number_of_columns() in SheetReader.to_array() #26

Merged
merged 1 commit into from Dec 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyexcel_io/sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def _cell_value(self, row, column):
def to_array(self):
"""2 dimentional representation of the content
"""
num_cols = self.number_of_columns()
for row in irange(self.number_of_rows()):
row_position = self.skip_row(row,
self.start_row,
Expand All @@ -71,7 +72,7 @@ def to_array(self):
return_row = []
tmp_row = []

for column in irange(0, self.number_of_columns()):
for column in irange(0, num_cols):
column_position = self.skip_column(column,
self.start_column,
self.column_limit)
Expand Down