diff options
author | Elliott Hughes <enh@google.com> | 2018-09-05 12:13:11 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2018-09-05 12:13:11 -0700 |
commit | 86ab9ff8a2eb283cb19045a93d2fc37a940ecedb (patch) | |
tree | 3fdc65d1ddd89f855f5e18625191769f2e2b974b /adb/client/commandline.cpp | |
parent | f33d19ff211317017bf7be936b32dafebc286ef9 (diff) | |
download | system_core-86ab9ff8a2eb283cb19045a93d2fc37a940ecedb.tar.gz system_core-86ab9ff8a2eb283cb19045a93d2fc37a940ecedb.tar.bz2 system_core-86ab9ff8a2eb283cb19045a93d2fc37a940ecedb.zip |
adb: static constexpr.
Also inline some single-use constants.
Bug: N/A
Test: ran tests
Change-Id: I1ac028667772599291da402120a270d0667fed04
Diffstat (limited to 'adb/client/commandline.cpp')
-rw-r--r-- | adb/client/commandline.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/adb/client/commandline.cpp b/adb/client/commandline.cpp index 451422fb0..a5cfd7f1c 100644 --- a/adb/client/commandline.cpp +++ b/adb/client/commandline.cpp @@ -354,8 +354,7 @@ static void stdinout_raw_epilogue(int inFd, int outFd, int old_stdin_mode, int o } void copy_to_file(int inFd, int outFd) { - constexpr size_t BUFSIZE = 32 * 1024; - std::vector<char> buf(BUFSIZE); + std::vector<char> buf(32 * 1024); int len; long total = 0; int old_stdin_mode = -1; @@ -367,9 +366,9 @@ void copy_to_file(int inFd, int outFd) { while (true) { if (inFd == STDIN_FILENO) { - len = unix_read(inFd, buf.data(), BUFSIZE); + len = unix_read(inFd, buf.data(), buf.size()); } else { - len = adb_read(inFd, buf.data(), BUFSIZE); + len = adb_read(inFd, buf.data(), buf.size()); } if (len == 0) { D("copy_to_file() : read 0 bytes; exiting"); |