Skip to content

Conversation

fit2bot
Copy link
Contributor

@fit2bot fit2bot commented Apr 17, 2025

perf: user login acl time_period

) {
value.rules.time_period = []
}

if (!Array.isArray(value.rules.ip_group)) {
value.rules.ip_group = value.rules.ip_group ? value.rules.ip_group.split(',') : []
}
Copy link
Member

Choose a reason for hiding this comment

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

There are no major discrepancies between the source of the code snippet in 2021 and the version you're providing today. The comments in the lines where the changes were made suggest that this is meant to be optimized for performance rather than maintainability, but I'll assume it isn't needed for discussion purposes.

However, here's an optimization suggestion in terms of readability:

if (value.rules.time_period && value.rules.time_period.length > 0 && !value.rules.time_period.every(item => item && item.value === '')) {
  // Remove empty items from time period rules
// ...
}

@feng626 feng626 merged commit 5766833 into dev Apr 17, 2025
3 of 4 checks passed
@feng626 feng626 deleted the pr@dev@user_login_acl branch April 17, 2025 06:20
Copy link

@fit2bot fit2bot requested a review from a team April 17, 2025 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants