Skip to content

Commit

Permalink
PR feedback: changes to _subscribe wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
levb committed Apr 29, 2024
1 parent c9f080d commit 82c672f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js.c
Original file line number Diff line number Diff line change
Expand Up @@ -2764,12 +2764,12 @@ _subscribe(natsSubscription **new_sub, jsCtx *js, const char *subject, const cha
natsMsgHandler usrCB, void *usrCBClosure, bool isPullMode,
jsOptions *jsOpts, jsSubOptions *opts, jsErrCode *errCode)
{
natsStatus s = NATS_OK;
const char *subjects[] = {subject};
int numSubjects = nats_IsStringEmpty(subject) ? 0 : 1;

if (nats_IsStringEmpty(subject))
return _subscribeMulti(new_sub, js, NULL, 0, pullDurable, usrCB, usrCBClosure, isPullMode, jsOpts, opts, errCode);

return _subscribeMulti(new_sub, js, subjects, 1, pullDurable, usrCB, usrCBClosure, isPullMode, jsOpts, opts, errCode);
s = _subscribeMulti(new_sub, js, subjects, numSubjects, pullDurable, usrCB, usrCBClosure, isPullMode, jsOpts, opts, errCode);
return NATS_UPDATE_ERR_STACK(s);
}

natsStatus
Expand Down

0 comments on commit 82c672f

Please sign in to comment.