Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the cache even used? #8

Closed
le717 opened this issue May 6, 2015 · 3 comments
Closed

Is the cache even used? #8

le717 opened this issue May 6, 2015 · 3 comments

Comments

@le717
Copy link
Contributor

le717 commented May 6, 2015

Noticed this while reading the code trying to comment it.

Lines 128-136 checks if the part has been cached. If it hasn't, it reads and caches it. But what happens if it is cached? That condition is not handled. Instead, it simply returns the myDef object constructed above which does not appear to be all the information needed.

Now, maybe I'm missing something, but it seems as if we only build the cache and never access it. In that case, it looks like the case needs to be handled and assign some key of myDef (sorry, can't figure out which) to self.__parts[myDef["partId"]] to take advantage of the cache.

@JoshTheDerf
Copy link
Owner

@le717 Since the parts are referred to by name, the only check needed is to see if the part is not already cached. If it is, then nothing needs to change since the partId is already referenced by name.

But yeah, the cache works fine. :)

I'll comment better next time, I prawmise. :3

@le717
Copy link
Contributor Author

le717 commented May 6, 2015

I'm not sure where then parts are being retrieved from the cache, but since it works, my question has been answered and this can be closed. :)

@le717 le717 closed this as completed May 6, 2015
@JoshTheDerf
Copy link
Owner

@le717 The idea is that parts never have to be "retrieved" until parsing the output. It might make sense if you take a closer look at the output format.

All the parser has to know is that a part is cached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants