ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kev Jackson <kevin.jack...@it.fts-vn.com>
Subject BZip2 tweaks
Date Thu, 24 Mar 2005 10:16:30 GMT
I looked at this before and I thought it could be improved, but when I 
saw the patch I decided to leave alone until that was applied.

I'm no expert on BZip compression, so my changes are relatively minor e.g.

     for (i = 0; i < MAX_CODE_LEN; i++) {
            base[i] = 0;
        }
        for (i = 0; i < alphaSize; i++) {
            base[length[i] + 1]++;
        }

        for (i = 1; i < MAX_CODE_LEN; i++) {
            base[i] += base[i - 1];
        }

        for (i = 0; i < MAX_CODE_LEN; i++) {
            limit[i] = 0; <-- this could be moved into the first for 
loop without impacting the code
        }

Indeed since all new int values are initialized as 0

for (i = 0; i < MAX_CODE_LEN; i++) {
            base[i] = 0;
        }

and

base[i] = new base[MAX_CODE_LEN]

should be equivalent shouldn't they?

Kev





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message