优化代码

除1024改成右移10位
This commit is contained in:
xia-chu
2024-11-29 23:07:02 +08:00
parent 67668c9f2c
commit 87b42ab492
13 changed files with 17 additions and 17 deletions

View File

@@ -84,7 +84,7 @@ static bool loadFile(const char *path){
}
timeStamp_last = timeStamp;
}
WarnL << total_size / 1024 << "KB";
WarnL << (total_size >> 10) << "KB";
fclose(fp);
return true;
}

View File

@@ -85,7 +85,7 @@ static bool loadFile(const char *path, const EventPoller::Ptr &poller) {
if (ps_decoder) {
ps_decoder->input(text, lSize);
}
WarnL << lSize / 1024 << "KB";
WarnL << (lSize >> 10) << "KB";
fclose(fp);
return true;
}

View File

@@ -89,7 +89,7 @@ static bool loadFile(const char *path, const EventPoller::Ptr &poller) {
poller->doDelayTask(1, [do_read, total_size, process]() mutable {
auto ret = do_read();
if (!ret) {
WarnL << *total_size / 1024 << "KB";
WarnL << (*total_size >> 10) << "KB";
}
return ret;
});