NITCbase / nitcbase.github.io

The entire documentation on implementing the NITCbase project.
https://nitcbase.github.io/
MIT License
10 stars 6 forks source link

Unnecessary calls in BlockBuffer::getFreeBlock() #20

Closed SaintNerevar closed 2 years ago

SaintNerevar commented 2 years ago

Block type is already set when setting the header using setHeader(). There is no need to call setBlockType again. setHeader() also calls getBufferPtr() which in turn calls getBlock() which calls getFreeBuffer() (everytime since the block number corresponds to an unallocated block) which makes calling getFreeBuffer() in getFreeBlock() unnecessary.

gokulsreekumar commented 2 years ago