aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-05-12 12:38:11 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2019-05-15 14:21:47 +0300
commit4030e7cb7ad54dd2df0686f41459fc6293c8284f (patch)
treee7366f78785419ad7d301fb68bc4b508fba9079e /mesonbuild/backend/backends.py
parent7b8ef78bc0002d0327626c6218b793f87c2a5eb8 (diff)
downloadmeson-4030e7cb7ad54dd2df0686f41459fc6293c8284f.zip
meson-4030e7cb7ad54dd2df0686f41459fc6293c8284f.tar.gz
meson-4030e7cb7ad54dd2df0686f41459fc6293c8284f.tar.bz2
UserOption no longer has a name field.
This avoids the duplication where the option is stored in a dict at its name, and also contains its own name. In general, the maxim in programming is things shouldn't know their own name, so removed the name field just leaving the option's position in the dictionary as its name.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 0565de3..d74157f 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -103,8 +103,7 @@ class TestSerialisation:
self.protocol = protocol
class OptionProxy:
- def __init__(self, name, value):
- self.name = name
+ def __init__(self, value):
self.value = value
class OptionOverrideProxy:
@@ -122,7 +121,7 @@ class OptionOverrideProxy:
def _get_override(self, option_name, base_opt):
if option_name in self.overrides:
- return OptionProxy(base_opt.name, base_opt.validate_value(self.overrides[option_name]))
+ return OptionProxy(base_opt.validate_value(self.overrides[option_name]))
return base_opt
def get_backend_from_name(backend, build):