Removed stringstream from assignment from double.
This commit is contained in:
1 parent
bfe5283492
commit
cca957b948
4 files changed
+8
-12
No files matched your search
+6
-10
@@ -84,11 +84,9 @@ namespace coreutils {
|
||||
}
|
||||
|
||||
MString::MString(double value) {
|
||||
std::stringstream temp;
|
||||
temp << std::format("{}", value);
|
||||
std::string temp2 = temp.str();
|
||||
setSize(temp2.length());
|
||||
memcpy(this->data, (char *)temp2.data(), temp2.length());
|
||||
std::string temp = std::format("{}", value);
|
||||
setSize(temp.length());
|
||||
memcpy(this->data, (char *)temp.data(), temp.length());
|
||||
cursor = this->data;
|
||||
}
|
||||
|
||||
@@ -133,11 +131,9 @@ namespace coreutils {
|
||||
}
|
||||
|
||||
MString &MString::operator=(double value) {
|
||||
std::stringstream temp;
|
||||
temp << std::format("{}", value);
|
||||
std::string temp2 = temp.str();
|
||||
setSize(temp2.length());
|
||||
memcpy(this->data, (char *)temp2.data(), temp2.length());
|
||||
std::string temp = std::format("{}", value);
|
||||
setSize(temp.length());
|
||||
memcpy(this->data, (char *)temp.data(), temp.length());
|
||||
cursor = this->data;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user