mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Pass ScriptResult by const reference instead of copying. #1834
This commit is contained in:
parent
784142022d
commit
736cefcdb6
3 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -440,7 +440,7 @@ void PortList::setServiceProbeResults(u16 portno, int protocol,
|
|||
|
||||
|
||||
#ifndef NOLUA
|
||||
void PortList::addScriptResult(u16 portno, int protocol, ScriptResult& sr) {
|
||||
void PortList::addScriptResult(u16 portno, int protocol, const ScriptResult& sr) {
|
||||
Port *port;
|
||||
|
||||
port = createPort(portno, protocol);
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ class PortList {
|
|||
void getServiceDeductions(u16 portno, int protocol, struct serviceDeductions *sd) const;
|
||||
|
||||
#ifndef NOLUA
|
||||
void addScriptResult(u16 portno, int protocol, ScriptResult& sr);
|
||||
void addScriptResult(u16 portno, int protocol, const ScriptResult& sr);
|
||||
#endif
|
||||
|
||||
/* Cycles through the 0 or more "ignored" ports which should be
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue