Skip to content

Commit

Permalink
refactor: remove unnecessary string conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelBoerlin authored and arogge committed Aug 5, 2023
1 parent e1808c1 commit 8dc1d2e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions core/src/dird/dird_conf.cc
Expand Up @@ -3093,38 +3093,38 @@ extern "C" std::optional<std::string> job_code_callback_director(JobControlRecor
switch (param[0]) {
case 'f':
if (jcr->dir_impl->res.fileset) {
return std::string(jcr->dir_impl->res.fileset->resource_name_);
return jcr->dir_impl->res.fileset->resource_name_;
}
break;
case 'h':
if (jcr->dir_impl->res.client) {
return std::string(jcr->dir_impl->res.client->address);
return jcr->dir_impl->res.client->address;
}
break;
case 'p':
if (jcr->dir_impl->res.pool) {
return std::string(jcr->dir_impl->res.pool->resource_name_);
return jcr->dir_impl->res.pool->resource_name_;
}
break;
case 'w':
if (jcr->dir_impl->res.write_storage) {
return std::string(jcr->dir_impl->res.write_storage->resource_name_);
return jcr->dir_impl->res.write_storage->resource_name_;
}
break;
case 'x':
return jcr->dir_impl->spool_data ? yes : no;
case 'C':
return jcr->dir_impl->cloned ? yes : no;
case 'D':
return std::string(my_name);
return my_name;
case 'V':
if (jcr) {
/* If this is a migration/copy we need the volume name from the
* mig_jcr. */
if (jcr->dir_impl->mig_jcr) { jcr = jcr->dir_impl->mig_jcr; }

if (jcr->VolumeName) {
return std::string(jcr->VolumeName);
return jcr->VolumeName;
} else {
return none;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/filed/fileset.cc
Expand Up @@ -60,7 +60,7 @@ extern "C" std::optional<std::string> job_code_callback_filed(JobControlRecord*
switch (param[0]) {
case 'D':
if (jcr->fd_impl->director) {
return std::string(jcr->fd_impl->director->resource_name_);
return jcr->fd_impl->director->resource_name_;
}
break;
case 'm':
Expand Down

0 comments on commit 8dc1d2e

Please sign in to comment.