Non pas d'erreur cf la doc de take.


On Mon, Feb 3, 2014 at 8:28 PM, Nicolas Joseph <notifications@github.com>wrote:

> In src/main/scala/org/discovery/vivaldi/system/Main.scala:
>
> >     */
> >    def getCloseNodesToSelf(excluded: Set[nodeInfo], numberOfNodes: Int): Seq[nodeInfo] = {
> >      // we take as a reference the current node, we only have to retrieve the n first elements of the list without the excluded nodes
> > -    closeNodes.filterNot(excluded contains).take(numberOfNodes)
> > +    if (numberOfNodes <= numberOfCloseNodes){
> > +      closeNodes.filterNot(excluded contains).take(numberOfNodes)
> > +    } else {
> > +      val temp = numberOfCloseNodes
> > +      numberOfCloseNodes = numberOfNodes
> > +      closeNodes.filterNot(excluded contains).take(temp)
>
> euh non : `numberOfNodes' sera supérieur à la taille du tableau. Je pense
> donc que cela lévera une erreur. d'où le passage par la variable temp.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/BeyondTheClouds/VivaldiGSI/pull/29/files#r9395541>
> .
>