Skip to content

Commit

Permalink
fix: remove useless empty buff (#497)
Browse files Browse the repository at this point in the history
* docs: LGTM badges
  • Loading branch information
robertsLando committed May 29, 2020
1 parent 86b6815 commit e60f85d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/moscajs/aedes/graphs/commit-activity)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/moscajs/aedes/pulls)\
![LGTM Grade](https://img.shields.io/lgtm/grade/javascript/github/moscajs/aedes)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/moscajs/aedes.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/moscajs/aedes/alerts/)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/moscajs/aedes.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/moscajs/aedes/context:javascript)
[![Coverage Status](https://coveralls.io/repos/moscajs/aedes/badge.svg?branch=master&service=github)](https://coveralls.io/github/moscajs/aedes?branch=master)
[![Known Vulnerabilities](https://snyk.io/test/github/moscajs/aedes/badge.svg)](https://snyk.io/test/github/moscajs/aedes)\
[![Dependencies Status](https://david-dm.org/moscajs/aedes/status.svg)](https://david-dm.org/moscajs/aedes)
Expand Down
4 changes: 1 addition & 3 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const mqtt = require('mqtt-packet')
const EventEmitter = require('events')
const util = require('util')
const eos = require('end-of-stream')
const empty = Buffer.allocUnsafe(0)
const Packet = require('aedes-packet')
const write = require('./write')
const QoSPacket = require('./qos-packet')
Expand Down Expand Up @@ -73,8 +72,7 @@ function Client (broker, conn, req) {
that._parsingBatch--
if (that._parsingBatch <= 0) {
that._parsingBatch = 0
var buf = empty
buf = client.conn.read(null)
var buf = client.conn.read(null)
if (!client.connackSent && client.broker.decodeProtocol && client.broker.trustProxy && buf) {
const { data } = client.broker.decodeProtocol(client, buf)
if (data) {
Expand Down

0 comments on commit e60f85d

Please sign in to comment.