1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

InAppPurchasesDemo: Avoid copies in range-for loops

This commit is contained in:
Oli 2022-10-28 12:24:50 +01:00
parent cb14ac2cae
commit 91dde1576d

View file

@ -192,7 +192,7 @@ private:
{
purchaseInProgress = false;
for (const auto productId : info.purchase.productIds)
for (const auto& productId : info.purchase.productIds)
{
auto idx = findVoiceIndexFromIdentifier (productId);
@ -218,9 +218,9 @@ private:
{
if (success)
{
for (auto& info : infos)
for (const auto& info : infos)
{
for (const auto productId : info.purchase.productIds)
for (const auto& productId : info.purchase.productIds)
{
auto idx = findVoiceIndexFromIdentifier (productId);
@ -241,7 +241,7 @@ private:
havePricesBeenFetched = true;
StringArray identifiers;
for (auto& voiceProduct : voiceProducts)
for (const auto& voiceProduct : voiceProducts)
identifiers.add (voiceProduct.identifier);
InAppPurchases::getInstance()->getProductsInformation (identifiers);