Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.

Commit fbaf440

Browse files
committed
refactor(SmartCard): don't move ATR, take it by const reference instead
1 parent 657bdd5 commit fbaf440

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/pcsc-cpp/pcsc-cpp.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ class SmartCard
222222
bool& inProgress;
223223
};
224224

225-
SmartCard(const ContextPtr& context, const string_t& readerName, byte_vector atr);
225+
SmartCard(const ContextPtr& context, const string_t& readerName, const byte_vector& atr);
226226
~SmartCard();
227227

228228
// The rule of five.

src/SmartCard.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ SmartCard::TransactionGuard::~TransactionGuard()
252252
}
253253
}
254254

255-
SmartCard::SmartCard(const ContextPtr& contex, const string_t& readerName, byte_vector atr) :
255+
SmartCard::SmartCard(const ContextPtr& contex, const string_t& readerName, const byte_vector& atr) :
256256
card(std::make_unique<CardImpl>(connectToCard(contex->handle(), readerName))),
257-
_protocol(convertToSmartCardProtocol(card->protocol())), _atr(std::move(atr))
257+
_protocol(convertToSmartCardProtocol(card->protocol())), _atr(atr)
258258
{
259259
// TODO: debug("Card ATR -> " + bytes2hexstr(atr));
260260
}

0 commit comments

Comments
 (0)