-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Save byte array allocations #15630
Save byte array allocations #15630
Conversation
@@ -3,7 +3,7 @@ | |||
@inject IContentManager ContentManager | |||
|
|||
@{ | |||
var matchAllQuery = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(@"SELECT * FROM ContentItemIndex")); | |||
var matchAllQuery = OrchardCore.Queries.Sql.ViewModels.AdminQueryViewModel.MatchAllQueryBase64; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var matchAllQuery = OrchardCore.Queries.Sql.ViewModels.AdminQueryViewModel.MatchAllQueryBase64; | |
var matchAllQuery = Model.MatchAllQueryBase64; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not part of the usings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I mean to use the model, I updated the above suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Static properties can't be accessed from instance references.
@@ -6,6 +6,8 @@ namespace OrchardCore.Queries.Sql.ViewModels | |||
{ | |||
public class AdminQueryViewModel | |||
{ | |||
public static string MatchAllQueryBase64 { get; } = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(@"SELECT * FROM ContentItemIndex")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static string MatchAllQueryBase64 { get; } = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(@"SELECT * FROM ContentItemIndex")); | |
public static string MatchAllQueryBase64 => Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(@"SELECT * FROM ContentItemIndex")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would evaluate on each call. Which was done before this change.
No description provided.