Skip to content

Commit c329cab

Browse files
author
DvirDukhan
committed
fixed PR comments
1 parent 52c9b24 commit c329cab

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/resultSet.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ class ResultSet {
4242
*/
4343
async parseResponse(resp) {
4444
if(Array.isArray(resp)) {
45-
var len = resp.length
46-
if(resp[len - 1] instanceof ReplyError ) throw resp[len-1];
47-
if(len < 3) {
48-
this._statistics = new Statistics(resp[len - 1]);
45+
let responseLen = resp.length;
46+
let statisticsIdx = responseLen - 1;
47+
if(resp[statisticsIdx] instanceof ReplyError ) throw resp[statisticsIdx];
48+
if(responseLen < 3) {
49+
this._statistics = new Statistics(resp[statisticsIdx]);
4950
} else {
5051
await this.parseResults(resp);
5152
this._resultsCount = this._results.length;

0 commit comments

Comments
 (0)