Skip to content

Optimize filter applying logic #2295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 27, 2019

Conversation

bahusoid
Copy link
Member

Avoid property map preparation logic (GetColumnsToTableAliasMap) if filters are disabled or there are no subclasses.
And few other related refactorings

@fredericDelaporte
Copy link
Member

CodeFactor seems to have a bug on this one.

@bahusoid

This comment has been minimized.

upTo = upTo >= 0 ? upTo : condition.Length;
string property = condition.Substring(startOfProperty, upTo - startOfProperty);

string fullColumn = propMap.ContainsKey(property) ? propMap[property] : string.Format("{0}.{1}", defaultAlias, property);
if (!propMap.TryGetValue(property, out var fullColumn))
fullColumn = string.IsNullOrEmpty(defaultAlias)
Copy link
Member

Choose a reason for hiding this comment

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

Robustness improvement by the way, in case some caller may omit the alias some days? Or an actual bug fix?

Copy link
Member Author

@bahusoid bahusoid Dec 26, 2019

Choose a reason for hiding this comment

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

It's logic from GetColumnsToTableAliasMap

But now this part is not executed for entities without sub-classes - so I added it here just in case (and for consistency)

@fredericDelaporte fredericDelaporte added this to the 5.3 milestone Dec 27, 2019
@fredericDelaporte fredericDelaporte merged commit 42c2f9b into nhibernate:master Dec 27, 2019
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.

2 participants