mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Small improvement. One less iteration pero object name requested.
This commit is contained in:
parent
dcf6d93c9c
commit
d21a42d7cf
1 changed files with 1 additions and 1 deletions
|
@ -937,12 +937,12 @@ class XMLDBgenerator {
|
|||
}
|
||||
/// Now iterate until not used name is found, incrementing the counter
|
||||
while (in_array($newnamewithsuffix, $used_names) || $this->isNameInUse($newnamewithsuffix, $suffix)) {
|
||||
$counter++;
|
||||
$newname = substr($name, 0, strlen($newname)-1) . $counter;
|
||||
$newnamewithsuffix = $newname;
|
||||
if ($suffix) {
|
||||
$newnamewithsuffix = $newnamewithsuffix . '_' . $suffix;
|
||||
}
|
||||
$counter++;
|
||||
}
|
||||
$namewithsuffix = $newnamewithsuffix;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue