MCPcopy Create free account
hub / github.com/apache/thrift / compare_functions

Function compare_functions

compiler/cpp/src/thrift/audit/t_audit.cpp:347–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347void compare_functions(const std::vector<t_function*>& newFunctionList, const std::vector<t_function*>& oldFunctionList)
348{
349 std::map<std::string, t_function*> newFunctionMap;
350 std::map<std::string, t_function*>::iterator newFunctionMapIt;
351 for(auto newFunctionIt : newFunctionList)
352 {
353 newFunctionMap[newFunctionIt->get_name()] = newFunctionIt;
354 }
355
356 for(auto oldFunctionIt : oldFunctionList)
357 {
358 newFunctionMapIt = newFunctionMap.find(oldFunctionIt->get_name());
359 if(newFunctionMapIt == newFunctionMap.end())
360 {
361 thrift_audit_failure("New Thrift File has missing function %s\n",oldFunctionIt->get_name().c_str());
362 continue;
363 }
364 else
365 {
366 //Function is found in both thrift files. Compare return type and argument list
367 compare_single_function(newFunctionMapIt->second, oldFunctionIt);
368 }
369 }
370
371}
372
373void compare_services(const std::vector<t_service*>& newServices, const std::vector<t_service*>& oldServices)
374{

Callers 1

compare_servicesFunction · 0.85

Calls 5

thrift_audit_failureFunction · 0.85
compare_single_functionFunction · 0.85
findMethod · 0.80
get_nameMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected