This repository was archived by the owner on Jun 28, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1010* promise: new API module
1111* errors: finish normalisation of all errors
1212
13+ ## Trunk
14+
15+ * src: cache length in loops
16+
1317## Version 4.8.8
1418
1519* api: fix regression in browser environments
Original file line number Diff line number Diff line change @@ -858,7 +858,7 @@ var Parser = /*#__PURE__*/function (_Transform) {
858858 if ( columns !== false ) {
859859 var obj = { } ; // Transform record array to an object
860860
861- for ( var i in record ) {
861+ for ( var i = 0 , l = record . length ; i < l ; i ++ ) {
862862 if ( columns [ i ] === undefined || columns [ i ] . disabled ) continue ;
863863 obj [ columns [ i ] . name ] = record [ i ] ;
864864 }
@@ -1326,7 +1326,7 @@ var isRecordEmpty = function isRecordEmpty(record) {
13261326var normalizeColumnsArray = function normalizeColumnsArray ( columns ) {
13271327 var normalizedColumns = [ ] ;
13281328
1329- for ( var i = 0 ; i < columns . length ; i ++ ) {
1329+ for ( var i = 0 , l = columns . length ; i < l ; i ++ ) {
13301330 var column = columns [ i ] ;
13311331
13321332 if ( column === undefined || column === null || column === false ) {
Original file line number Diff line number Diff line change @@ -726,7 +726,7 @@ class Parser extends Transform {
726726 if ( columns !== false ) {
727727 const obj = { }
728728 // Transform record array to an object
729- for ( let i in record ) {
729+ for ( let i = 0 , l = record . length ; i < l ; i ++ ) {
730730 if ( columns [ i ] === undefined || columns [ i ] . disabled ) continue
731731 obj [ columns [ i ] . name ] = record [ i ]
732732 }
@@ -1090,8 +1090,7 @@ const isRecordEmpty = function(record){
10901090
10911091const normalizeColumnsArray = function ( columns ) {
10921092 const normalizedColumns = [ ] ;
1093-
1094- for ( let i = 0 ; i < columns . length ; i ++ ) {
1093+ for ( let i = 0 , l = columns . length ; i < l ; i ++ ) {
10951094 const column = columns [ i ]
10961095 if ( column === undefined || column === null || column === false ) {
10971096 normalizedColumns [ i ] = { disabled : true }
You can’t perform that action at this time.
0 commit comments