1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Pass ScriptResult by const reference instead of copying. #1834

This commit is contained in:
dmiller
2019-12-29 05:15:12 +00:00
parent 784142022d
commit 736cefcdb6
3 changed files with 4 additions and 4 deletions

View File

@@ -512,11 +512,11 @@ std::string protect_xml(const std::string s) {
/* This is a helper function to determine the ordering of the script results
based on their id. */
static bool scriptid_lessthan(ScriptResult a, ScriptResult b) {
static bool scriptid_lessthan(const ScriptResult &a, const ScriptResult &b) {
return strcmp(a.get_id(), b.get_id()) < 0;
}
static char *formatScriptOutput(ScriptResult sr) {
static char *formatScriptOutput(const ScriptResult &sr) {
std::vector<std::string> lines;
std::string c_output;