mirror of
https://github.com/friendica/friendica
synced 2025-04-26 16:30:12 +00:00
Enable Model lazy updating based on only the changed data
- Simplify update decision in Database
This commit is contained in:
parent
f0474c07ce
commit
559879f41f
3 changed files with 23 additions and 13 deletions
|
@ -1342,19 +1342,13 @@ class Database
|
|||
}
|
||||
}
|
||||
|
||||
$do_update = (count($old_fields) == 0);
|
||||
|
||||
foreach ($old_fields AS $fieldname => $content) {
|
||||
if (isset($fields[$fieldname])) {
|
||||
if (($fields[$fieldname] == $content) && !is_null($content)) {
|
||||
unset($fields[$fieldname]);
|
||||
} else {
|
||||
$do_update = true;
|
||||
}
|
||||
if (isset($fields[$fieldname]) && !is_null($content) && ($fields[$fieldname] == $content)) {
|
||||
unset($fields[$fieldname]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$do_update || (count($fields) == 0)) {
|
||||
if (count($fields) == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue