Skip to content

perf: Avoid calling getById on root#207

Closed
CarlSchwan wants to merge 1 commit intomainfrom
carl/fix-rootfolder-getById-usage
Closed

perf: Avoid calling getById on root#207
CarlSchwan wants to merge 1 commit intomainfrom
carl/fix-rootfolder-getById-usage

Conversation

@CarlSchwan
Copy link
Member

No description provided.

if (!$this->allowedPath($node) || $user === null) {
return;
}
$userFolder = $this->rootFolder->getUserFolder($user);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$userFolder = $this->rootFolder->getUserFolder($user);
$userFolder = $this->rootFolder->getUserFolder($user->getUID());

public function onInsert(Node $node, bool $recurse = true, bool $update = false): void {
if (!$this->allowedPath($node)) {
$user = $node->getOwner();
if (!$this->allowedPath($node) || $user === null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the second allowedPath check below can be removed

Signed-off-by: Carl Schwan <carlschwan@kde.org>
@CarlSchwan CarlSchwan force-pushed the carl/fix-rootfolder-getById-usage branch from 70aebc4 to 724c291 Compare February 3, 2026 11:51
@CarlSchwan CarlSchwan closed this Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants