Return correct type indices for primitive types referred to by their CLR type names#12956
Merged
aparajit-pratap merged 3 commits intoDynamoDS:masterfrom Jun 6, 2022
Merged
Conversation
mjkkirschner
reviewed
Jun 3, 2022
mjkkirschner
approved these changes
Jun 3, 2022
mjkkirschner
reviewed
Jun 3, 2022
| if (index != Constants.kInvalidIndex) return index; | ||
|
|
||
| if(clrToDSTypeMap.TryGetValue(ident, out string dsType)) | ||
| return classTable.IndexOf(dsType); |
Member
There was a problem hiding this comment.
while I think this PR looks good - I am curious if you think there could be performance implications here, this IndexOf call doesn't seem to be straight forward, it seems to do partial matching? So in the worst case we'll now do 2x the lookups in some pathologically bad cases, do you think those will come up rarely, and if so is this method classTable.IndexOf linear in complexity or something worse?
Contributor
Author
There was a problem hiding this comment.
I think right now, it's only going to take place for a node like RemoveIfNot where there is the possibility of checking for a C# type.
Member
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Return correct type indices for primitive types referred to by their CLR type names - this permits a node like
List.RemoveIfNotto work with not just the DS types passed as input, but also the C# type. For e.g. it now works for both the DS typeintbut also the equivalent C# type,System.Int64type.Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
List.RemoveIfNotnow supports C# type such as that returned fromObject.Type.FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of