Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Sep 12, 2018
1 parent fe893e1 commit 3154bcf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ogame.go
Original file line number Diff line number Diff line change
Expand Up @@ -1464,8 +1464,9 @@ func extractFleets(pageHTML string) (res []Fleet) {
fleet.ArriveIn = secs

for i := 1; i < trs.Size()-5; i++ {
name := strings.ToLower(strings.Trim(trs.Eq(i).Find("td").Eq(0).Text(), "\n\t\r :"))
qty := parseInt(strings.Trim(trs.Eq(i).Find("td").Eq(1).Text(), "\n\t\r "))
tds := trs.Eq(i).Find("td")
name := strings.ToLower(strings.Trim(tds.Eq(0).Text(), "\n\t\r :"))
qty := parseInt(tds.Eq(1).Text())
shipID, _ := parseShip(name)
fleet.Ships.Set(shipID, qty)
}
Expand Down

0 comments on commit 3154bcf

Please sign in to comment.