Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

too much loop in AbstractQueryChain #8

Open
jeromedecoster opened this issue Jan 31, 2011 · 2 comments
Open

too much loop in AbstractQueryChain #8

jeromedecoster opened this issue Jan 31, 2011 · 2 comments

Comments

@jeromedecoster
Copy link

Hello,

I just found this. It seems you loop 2 times in the first IQueryPart. And, correct me if I'm wrong, it's not usefull.
https://github.com/sammyt/fussy/blob/master/src/uk/co/ziazoo/fussy/query/AbstractQueryChain.as#L47

I suggest this:

  var firstPart:IQueryPart = parts[0];
  var lastResult:XMLList = firstPart.filter(getList(reflector.forType(type)));

 if (parts.length > 1)
{
  var i:int = parts.length - 1;

  while (i > 0)
  {
    var part:IQueryPart = parts[i];
    lastResult = part.filter(lastResult);
    i--;
  }
}

return lastResult;

Thanks for Fussy, it's excellent!

PS : I also note that the addQueryPart method is never used. Is it needed ? Can you provide an example please ?

https://github.com/sammyt/fussy/blob/master/src/uk/co/ziazoo/fussy/query/AbstractQueryChain.as#L71

@sammyt
Copy link
Owner

sammyt commented Feb 9, 2011

Hello there,

Good spot! you are quite right. I will change it this weekend, or if you would rather change it yourself I would be happy to accept a pull request

addQueryPart is not currently used, you're right. I had planned to use it to intercept all new query parts when they were added so I could implement caching down the filter tree... but I havent got round to it.. so right now its redundant :)

Really pleased fussy is working well for you!

Sorry for the slow reply!!

Sammy :)

@jeromedecoster
Copy link
Author

Hello,
Thanks for your reply. Sorry for the pull request, it's true, it's easier for you, but I don't use Git. I don't fork because Git turn me mad :)
If you plan to update this we, I also notice this little stuff :

An unused var, probably a forgotten test var :
https://github.com/sammyt/fussy/blob/master/src/uk/co/ziazoo/fussy/query/WithMetadata.as#L15

PS : I also notice your new projet TopDown. Seems strange. I hope you'll make one day a readme file like for fussy.

Bye !

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

No branches or pull requests

2 participants