yaptv/YapDatabase — pull request #68 by choefele (2014-04-10 10:56:57+00:00)
Title: Fixed Xcode analyzer issues

Thanks for this project.

I had a look at the analyzer issues reported by Xcode:

_Projects/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m:995:3: Value stored to 'srcCollection' is never read_

`srcCollection` defaulted to `@""` after it was used the first time, so I moved it to the top of the method. Often, the callers of `findChangesMatchingName:sourceKey:collection:rowid:destinationFilePath:` will also default initialize the collection name, but it looked safest to keep it in this method as well. Alternatively, you might want to assert that `srcCollection` is not `nil`.

_Projects/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m:2359:9: Access to instance variable 'count' results in a dereference of a null pointer (loaded from variable 'pageMetadata')_

I added an extra check to not execute the `while` loop if `pageMetadata` is `nil`. I also removed the code to set `pageMetadata` to `nil` because this is the default for ARC.

_Projects/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m:1434:3: Branch condition evaluates to a garbage value (within a call to 'FreeYapDatabaseString')_
_Projects/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m:1436:2: Potential leak of memory pointed to by '_dstFilePath.str'_

I think this code is correct, but the analyzer seems to get confused by `[edge copy]` which might modify `edge`. For this reason, I'm now using a `BOOL` to make sure `FreeYapDatabaseString` is called when needed.

Please have a look, thanks