Skip to content

Commit 33c5ee1

Browse files
authored
update workflow submodule. (#424)
1 parent 701642e commit 33c5ee1

4 files changed

Lines changed: 9 additions & 14 deletions

File tree

WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rules_proto_toolchains()
1818

1919
git_repository(
2020
name = "workflow",
21-
commit = "8076c75051f943c29bae79a2a32d61eda48e582e",
21+
commit = "7bbdf060f7a8e0aba7a3bbcb988d907b1a6ac38a",
2222
remote = "https://github.com/sogou/workflow.git")
2323

2424
new_git_repository(

tools/templates/config/Json.cc

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void Json::erase(const std::string& key)
264264

265265
Json Json::operator[](int index)
266266
{
267-
if (!is_array() || index < 0 || index > this->size())
267+
if (!is_array() || index < 0 || index > (int)this->size())
268268
{
269269
return Json();
270270
}
@@ -299,7 +299,7 @@ void Json::erase(int index)
299299

300300
Json Json::operator[](int index) const
301301
{
302-
if (!is_array() || index < 0 || index > this->size())
302+
if (!is_array() || index < 0 || index > (int)this->size())
303303
{
304304
return Json();
305305
}
@@ -729,7 +729,7 @@ std::string Json::type_str() const
729729
return "unknown";
730730
}
731731

732-
int Json::size() const
732+
size_t Json::size() const
733733
{
734734
if (type() == JSON_VALUE_ARRAY)
735735
{
@@ -889,14 +889,9 @@ void Json::string_convert(const char* str, std::string* out_str)
889889

890890
void Json::number_convert(double number, std::string* out_str)
891891
{
892-
std::ostringstream oss;
893-
long long integer = number;
894-
if (integer == number)
895-
oss << integer;
896-
else
897-
oss << number;
898-
899-
out_str->append(oss.str());
892+
char buf[32];
893+
snprintf(buf, 32, "%.15lg", number);
894+
out_str->append(buf);
900895
}
901896

902897
void Json::array_convert_not_format(const json_array_t* arr,

tools/templates/config/Json.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class Json
180180
return node_ != nullptr;
181181
}
182182

183-
int size() const;
183+
size_t size() const;
184184

185185
bool empty() const;
186186

workflow

Submodule workflow updated 44 files

0 commit comments

Comments
 (0)