Show
Ignore:
Timestamp:
07/19/07 22:46:09 (6 years ago)
Author:
khali
Message:

The way we use sensors_feature_get_type() is rather suboptimal. It is
first called during the library initialization to generate the feature
tables. Then it is called again by sensors itself. This is because we
do not store the result the first time. I propose that we add a type
field to struct sensors_feature_data, where libsensors would store
the result of sensors_feature_get_type(). That way, the application
can get the information without calling sensors_feature_get_type()
again.

This change has the following benefits:
* Obviously, a small speed-up.
* sensors_feature_get_type() can be removed from the public interface.

This means that we can turn it into something that fits the
libsensors needs better, allowing for more optimizations (see next
patches.)

Note: the patch looks bigger that it really is, because I had to move
definitions around in sensors.h.

Files:
1 modified

Legend:

Unmodified
Added
Removed