Since the code only does anything if both substrings are found, implement an early-out if either of them isn't found. This seems like a micro-optimization at first, but since the current node socket versioning requires looping over all AnimData in the file, this adds up to e.g. 1.9sec saved when loading the Spring benchmark file.