Skip to content
Snippets Groups Projects
Commit 11c7606f authored by Moe Jette's avatar Moe Jette
Browse files

Minor code changes for greater efficiency. Minimal changes to logic.

parent 51e15955
No related branches found
No related tags found
No related merge requests found
...@@ -2044,20 +2044,16 @@ _copy_job_desc_to_job_record(job_desc_msg_t * job_desc, ...@@ -2044,20 +2044,16 @@ _copy_job_desc_to_job_record(job_desc_msg_t * job_desc,
*/ */
static char *_copy_nodelist_no_dup(char *node_list) static char *_copy_nodelist_no_dup(char *node_list)
{ {
int new_size = 64; char buf[8192];
char *new_str;
hostlist_t hl = hostlist_create(node_list); hostlist_t hl = hostlist_create(node_list);
if (hl == NULL) if (hl == NULL)
return NULL; return NULL;
hostlist_uniq(hl); hostlist_uniq(hl);
new_str = xmalloc(new_size); hostlist_ranged_string(hl, 8192, buf);
while (hostlist_ranged_string(hl, new_size, new_str) == -1) {
new_size *= 2;
xrealloc(new_str, new_size);
}
hostlist_destroy(hl); hostlist_destroy(hl);
return new_str;
return xstrdup(buf);
} }
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment