From 3dcdcf8d3b14a19603342eb3b0f3307b76dfd768 Mon Sep 17 00:00:00 2001 From: Stas Degteff Date: Sun, 21 Mar 2010 12:15:07 +0000 Subject: [PATCH] Small optimisation --- goldlib/gmb3/gmosqsh2.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/goldlib/gmb3/gmosqsh2.cpp b/goldlib/gmb3/gmosqsh2.cpp index de53361..33899f2 100644 --- a/goldlib/gmb3/gmosqsh2.cpp +++ b/goldlib/gmb3/gmosqsh2.cpp @@ -60,11 +60,12 @@ void SquishArea::refresh() { // Are there any msgs? if(data->base.totalmsgs) { + uint idxsize=data->base.totalmsgs*sizeof(SqshIdx); // Read the index file - data->idx = (SqshIdx*)throw_realloc(data->idx, (uint)(data->base.totalmsgs*sizeof(SqshIdx))); + data->idx = (SqshIdx*)throw_realloc(data->idx, idxsize); lseekset(data->fhsqi, 0); - read(data->fhsqi, data->idx, (uint)(data->base.totalmsgs*sizeof(SqshIdx))); + read(data->fhsqi, data->idx, idxsize); } GFTRK(0);