On Fri, Apr 6, 2012 at 12:07, Pascal Terjan <pter...@gmail.com> wrote:
> > > On Fri, Apr 6, 2012 at 09:34, Guillaume Rousse <guillomovi...@gmail.com>wrote: > >> >> What about using consistent variable names ? If you have a collection of >> 'something' stored in a hash, why should it suddenly became of collection >> of 'st' when transfering them into an array ? > > > In this case, the hash contains the existing partitions, hence %parts, > while the array represents the full partition table, hence @pt > > Or using a consistent format for variables storing numbers, rather than >> having both nb_foo and bar_number ? >> > > nb_primary is the number of primary partitions (count if you prefer), > part_number is the position of a given partition in the table. > > >> >> And I don't underestand the interest of using an hash for storing content >> with numerical indexes only. Especially if you have to convert it to an >> array at the end... > > > To easily get the (potential) one with current index when filling the > array. The other solution would be to first create the array with 128 > default structures, then replace some of them. > Hmm or actually just put them in the array and then fill the holes