Author Topic: using .Equals on Color creates garbage in UIWidget and UILabel  (Read 3351 times)

Amimoller

  • Guest
using .Equals on Color creates garbage in UIWidget and UILabel
« on: November 29, 2013, 02:59:09 AM »
Hi,
I noticed that Color.Equals() is being used to compare colors in UIWidget and UILabel. This produces garbage because the color (which is a value type) is passed as an argument has to be boxed to an object.
You should be able to use != or == instead which takes a color as an argument and therefore does not create garbage.

Cheers!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: using .Equals on Color creates garbage in UIWidget and UILabel
« Reply #1 on: November 29, 2013, 09:27:14 AM »
In which version? I don't see it being used in the latest.

hogwash

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: using .Equals on Color creates garbage in UIWidget and UILabel
« Reply #2 on: December 12, 2013, 01:45:52 AM »
Yeah I'm seeing the same issue. Line 132 of UIWidget.cs build 3.0.5

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: using .Equals on Color creates garbage in UIWidget and UILabel
« Reply #3 on: December 12, 2013, 01:50:04 AM »
You need to update.