-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Revisit need of Map.Update<Type> and Map.Insert<Type> #5998
Comments
|
@bogdandrutu Looks like we are left with 11 Insert occurrences in contrib that cannot be replaced without changing the functionality. It seems a small enough number to replace them with Get->Upsert. WDYT? |
@dmitryax agreed, for the moment does not seem that important to offer "Insert" like functionality. Let's deprecate, and we should finalize the name for "Upsert" since that confused lots of people (everyone was using "Insert" as default) |
@dmitryax only one task left, to find a better name than "Upsert". I think we can close this and open a new issue for that. |
@bogdandrutu Submitted #6059 |
We need to make sure that all the pdata API is needed before declaring 1.0.
Problem with
Map.Update<Type>
andMap.Insert<Type>
is that they cannot be applied to all the types.Map.Upsert...
methods that require returning a value (e.g.Map.UpsertEmpty
orMap.UpsertEmptyMap
) cannot have clean and useful equivalents forMap.Update...
andMap.Insert...
.Usage of
Update...
in contrib is very limited. There are only few places where it's actually needed. Most ofInsert...
usages in contrib can be replaced withUpsert...
since there is no data under the key.All the use cases when
Update...
andInsert...
are really needed can be replaced with a combination ofGet
andUpsert...
.Removing
Update...
andInsert...
helps us to keep the Map API concise and consistent.Upsert...
methods can be potentially renamed toPut...
.The text was updated successfully, but these errors were encountered: