Use missingEncodedBlocksCount directly instead of "-1" workaround in missingEncodedBlocks[]

Makes Code more readable
This commit is contained in:
Krishna Srinivas
2015-07-28 16:51:57 +05:30
parent 55d22fa8d6
commit 1ea91d2fa2
3 changed files with 10 additions and 9 deletions

View File

@@ -22,10 +22,10 @@
#include "ec_minio_common.h"
static
int32_t _minio_src_index_in_error (int r, int32_t *error_index)
int32_t _minio_src_index_in_error (int r, int32_t *error_index, int errs)
{
int i;
for (i = 0; error_index[i] != -1; i++) {
for (i = 0; i < errs; i++) {
if (error_index[i] == r) {
// true
return 1;
@@ -88,7 +88,7 @@ int minio_init_decoder (int32_t *error_index,
uint32_t tmp_decode_index[k];
for (i = 0, r = 0; i < k; i++, r++) {
while (_minio_src_index_in_error(r, error_index))
while (_minio_src_index_in_error(r, error_index, errs))
r++;
for (j = 0; j < k; j++) {
input_matrix[k * i + j] = encode_matrix[k * r + j];