Bug 487849 - Is there any check for QMap creating an item by default when using [] to reference an item?
Summary: Is there any check for QMap creating an item by default when using [] to refe...
Status: REPORTED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-31 20:24 UTC by albrightsteve
Modified: 2024-06-03 02:26 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description albrightsteve 2024-05-31 20:24:57 UTC
If you have a QMap and do if(yourMap[someKey]==someValue) it creates a map item and later on a contains will find it despite the unintentional creation.
Comment 1 albrightsteve 2024-06-03 02:25:59 UTC
I forgot to mention, this violates having const C++ functions too if data members are getting modified.