Squashed 'subtree/rabit/' changes from 27340f9..fed1683
fed1683 minor c01520f change git-subtree-dir: subtree/rabit git-subtree-split: fed1683b9bb031041cc2bf113633cfd40c9faf46
This commit is contained in:
parent
c0e0fc0c91
commit
d16b2c9670
@ -310,9 +310,10 @@ template<typename T>
|
|||||||
inline bool Stream::Read(std::vector<T> *out_vec) {
|
inline bool Stream::Read(std::vector<T> *out_vec) {
|
||||||
uint64_t sz;
|
uint64_t sz;
|
||||||
if (this->Read(&sz, sizeof(sz)) == 0) return false;
|
if (this->Read(&sz, sizeof(sz)) == 0) return false;
|
||||||
out_vec->resize(static_cast<size_t>(sz));
|
size_t size = static_cast<size_t>(sz);
|
||||||
|
out_vec->resize(size);
|
||||||
if (sz != 0) {
|
if (sz != 0) {
|
||||||
if (this->Read(&(*out_vec)[0], sizeof(T) * sz) == 0) return false;
|
if (this->Read(&(*out_vec)[0], sizeof(T) * size) == 0) return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -326,9 +327,10 @@ inline void Stream::Write(const std::string &str) {
|
|||||||
inline bool Stream::Read(std::string *out_str) {
|
inline bool Stream::Read(std::string *out_str) {
|
||||||
uint64_t sz;
|
uint64_t sz;
|
||||||
if (this->Read(&sz, sizeof(sz)) == 0) return false;
|
if (this->Read(&sz, sizeof(sz)) == 0) return false;
|
||||||
out_str->resize(static_cast<size_t>(sz));
|
size_t size = static_cast<size_t>(sz);
|
||||||
|
out_str->resize(size);
|
||||||
if (sz != 0) {
|
if (sz != 0) {
|
||||||
if (this->Read(&(*out_str)[0], sizeof(char) * sz) == 0) {
|
if (this->Read(&(*out_str)[0], sizeof(char) * size) == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user