Browse Source

Merge pull request #139 from bluej100/autofast

use fast mode automatically when safe
pull/159/head
Matt Holt 10 years ago
parent
commit
247a345ee2
  1. 15
      papaparse.js

15
papaparse.js

@ -967,24 +967,29 @@ @@ -967,24 +967,29 @@
if (!input)
return returnable();
if (fastMode)
if (fastMode || input.indexOf('"') === -1)
{
// Fast mode assumes there are no quoted fields in the input
var rows = input.split(newline);
for (var i = 0; i < rows.length; i++)
{
if (comments && rows[i].substr(0, commentsLen) == comments)
var row = rows[i];
cursor += row.length;
if (i !== rows.length - 1)
cursor += newline.length;
else if (ignoreLastRow)
return returnable();
if (comments && row.substr(0, commentsLen) == comments)
continue;
if (stepIsFunction)
{
data = [];
pushRow(rows[i].split(delim));
pushRow(row.split(delim));
doStep();
if (aborted)
return returnable();
}
else
pushRow(rows[i].split(delim));
pushRow(row.split(delim));
if (preview && i >= preview)
{
data = data.slice(0, preview);

Loading…
Cancel
Save