Skip to content

Commit ff3e848

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

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/resultSet.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ class ResultSet {
4242
*/
4343
async parseResponse(resp) {
4444
if(Array.isArray(resp)) {
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]);
45+
let statistics = resp[resp.length - 1];
46+
if(statistics instanceof ReplyError) throw statistics;
47+
if(resp.length < 3) {
48+
this._statistics = new Statistics(statistics);
5049
} else {
5150
await this.parseResults(resp);
5251
this._resultsCount = this._results.length;

0 commit comments

Comments
 (0)