def METHOD_NAME(self, buildid, properties):
    to_update = {}
    oldproperties = yield self.master.data.get(('builds', str(buildid), "properties"))
    properties = properties.getProperties()
    properties = yield properties.render(properties.asDict())
    for k, v in properties.items():
        if k in oldproperties and oldproperties[k] == v:
            continue
        to_update[k] = v
    if to_update:
        for k, v in to_update.items():
            yield self.master.db.builds.setBuildProperty(
                buildid, k, v[0], v[1])
        yield self.generateUpdateEvent(buildid, to_update)