FunctionStringMap: improve code-reuse

The serialize() method now uses the serialize() function provided by
revng/Support/YAMLTraits.h, so we don't have to explictly const_cast.
This commit is contained in:
Pietro Fezzardi
2022-05-11 14:38:00 +02:00
parent 1bb5bd6eee
commit 20fea32ce1
+1 -2
View File
@@ -119,8 +119,7 @@ struct CustomMappingTraits<std::map<MetaAddress, StringType>> {
namespace revng::pipes {
llvm::Error FunctionStringMap::serialize(llvm::raw_ostream &OS) const {
llvm::yaml::Output YAMLOutput(OS);
YAMLOutput << const_cast<std::map<MetaAddress, String> &>(Map);
::serialize(OS, Map);
return llvm::Error::success();
}