Revert "missing round bracket"

This reverts commit dcac69c400b3b4d9bdc6444a635969431fae4fb4.
Revert "remove optimasations to find snp index"

This reverts commit 8fa4e66b78fb8dc7f0a5d308e1d149365874e5bf.
realloc without keeping track of new pointer