From c0099b86ce3bfe936988b17654dbd3f1698efd90 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Thu, 11 May 2017 14:09:40 +0300 Subject: [PATCH] Adding comment at IsEnoughSpaceForDownload() method. --- storage/storage_helpers.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/storage/storage_helpers.cpp b/storage/storage_helpers.cpp index a636902b67..4ee47f5c52 100644 --- a/storage/storage_helpers.cpp +++ b/storage/storage_helpers.cpp @@ -33,6 +33,9 @@ bool IsEnoughSpaceForDownload(TCountryId const & countryId, Storage const & stor { NodeAttrs nodeAttrs; storage.GetNodeAttrs(countryId, nodeAttrs); + // The type of nodeAttrs.m_mwmSize and nodeAttrs.m_localMwmSize is TMwmSize (uint64_t). + // The condition below is necessary to prevent passing a big positive number as the first + // parameter of IsEnoughSpaceForDownload(). return IsEnoughSpaceForDownload(nodeAttrs.m_mwmSize > nodeAttrs.m_localMwmSize ? nodeAttrs.m_mwmSize - nodeAttrs.m_localMwmSize : 0, storage.GetMaxMwmSizeBytes());