|
|
@ -146,15 +146,22 @@ static void json_array_to_bitfield(B & bits, Json::Value & arr)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (Json::ArrayIndex i = arr.size() - 1; i != 0; i--)
|
|
|
|
for (Json::ArrayIndex i = arr.size(); i != 0; i--)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!arr[i - 1].isString())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string str(arr[i - 1].asString());
|
|
|
|
|
|
|
|
|
|
|
|
int current;
|
|
|
|
int current;
|
|
|
|
if (get_bitfield_field(¤t, bits, arr[i].asString()))
|
|
|
|
if (get_bitfield_field(¤t, bits, str))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!current && set_bitfield_field(&bits, arr[i].asString(), 1))
|
|
|
|
if (!current && set_bitfield_field(&bits, str, 1))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Json::Value removed;
|
|
|
|
Json::Value removed;
|
|
|
|
arr.removeIndex(i, &removed);
|
|
|
|
arr.removeIndex(i - 1, &removed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|