adb: static constexpr.
Also inline some single-use constants.
Bug: N/A
Test: ran tests
Change-Id: I1ac028667772599291da402120a270d0667fed04
diff --git a/adb/client/commandline.cpp b/adb/client/commandline.cpp
index 451422f..a5cfd7f 100644
--- a/adb/client/commandline.cpp
+++ b/adb/client/commandline.cpp
@@ -354,8 +354,7 @@
}
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 @@
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");