mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
Removing some unenessacary repetition
This commit is contained in:
parent
f14ac390bf
commit
99bf74faae
@ -13,6 +13,8 @@ using serial::stopbits_t;
|
|||||||
using serial::flowcontrol_t;
|
using serial::flowcontrol_t;
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
using std::numeric_limits;
|
||||||
|
using std::size_t;
|
||||||
|
|
||||||
Serial::Serial (const string &port, int baudrate,
|
Serial::Serial (const string &port, int baudrate,
|
||||||
long timeout, bytesize_t bytesize,
|
long timeout, bytesize_t bytesize,
|
||||||
@ -89,7 +91,7 @@ Serial::readlines(string eol) {
|
|||||||
size_t leneol = eol.length();
|
size_t leneol = eol.length();
|
||||||
vector<string> lines;
|
vector<string> lines;
|
||||||
while (true) {
|
while (true) {
|
||||||
string line = readline(std::numeric_limits<std::size_t>::max(), eol);
|
string line = readline(numeric_limits<size_t>::max(), eol);
|
||||||
if (!line.empty()) {
|
if (!line.empty()) {
|
||||||
lines.push_back(line);
|
lines.push_back(line);
|
||||||
if (line.substr(line.length() - leneol, leneol) == eol)
|
if (line.substr(line.length() - leneol, leneol) == eol)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user