Initial implementation of metadata serde

Good catch, haha. :-/ I guess I caught copy/pasting my for..loop.


On Mon, Jun 9, 2014 at 10:21 PM, eawagner <notifications@github.com> wrote:

> In
> commons/src/main/java/org/calrissian/accumulorecipes/commons/support/metadata/BaseMetadataSerDe.java:
>
> > +        try {
> > +            ByteArrayOutputStream baos = new ByteArrayOutputStream();
> > +            DataOutput dataOutput = new DataOutputStream(baos);
> > +
> > +            int count = 0;
> > +            for(Map.Entry<String, Object> entry : metadata.entrySet()) {
> > +                if(entry.getValue() != null)
> > +                    count++;
> > +            }
> > +
> > +            dataOutput.writeInt(count);
> > +
> > +            for(Map.Entry<String, Object> entry : metadata.entrySet()) {
> > +                if(entry.getValue() != null)
> > +                    count++;
> > +            }
>
> Why are you recalculating count again?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/calrissian/accumulo-recipes/pull/175/files#r13575122>.
>