summaryrefslogtreecommitdiff
path: root/src/compression/bwt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compression/bwt.c')
-rw-r--r--src/compression/bwt.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/compression/bwt.c b/src/compression/bwt.c
index 66d3ecf..681d66b 100644
--- a/src/compression/bwt.c
+++ b/src/compression/bwt.c
@@ -1,7 +1,7 @@
/* This code is part of the tng compression routines.
*
- * Written by Daniel Spangberg
- * Copyright (c) 2010, 2013, The GROMACS development team.
+ * Written by Daniel Spangberg and Magnus Lundborg
+ * Copyright (c) 2010, 2013-2014 The GROMACS development team.
*
*
* This program is free software; you can redistribute it and/or
@@ -162,8 +162,9 @@ void Ptngc_comp_to_bwt(unsigned int *vals, int nvals,
indices[i]=i;
/* Find the length of the initial repeating pattern for the strings. */
/* First mark that the index does not have a found repeating string. */
- for (i=0; i<nvals; i++)
- nrepeat[i]=0U;
+
+ memset(nrepeat, 0U, sizeof(unsigned int) * nvals);
+
#ifdef SHOWIT
printf("nvals is %d\n",nvals);
#endif
@@ -312,8 +313,9 @@ void Ptngc_comp_from_bwt(unsigned int *input, int nvals, int index,
unsigned int *c=warnmalloc(0x10000*sizeof *c);
unsigned int *p=warnmalloc(nvals*sizeof *p);
unsigned int sum=0;
- for (i=0; i<0x10000; i++)
- c[i]=0;
+
+ memset(c, 0, sizeof(unsigned int) * 0x10000);
+
for (i=0; i<nvals; i++)
{
p[i]=c[input[i]];
contact: Jan Huwald // Impressum