[vala/staging] libvaladoc: Drop unused code



commit c3b972e14a71fecb5a8ebd01193f559931ee174e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Oct 10 18:01:22 2019 +0200

    libvaladoc: Drop unused code

 libvaladoc/api/typereference.vala | 82 ---------------------------------------
 1 file changed, 82 deletions(-)
---
diff --git a/libvaladoc/api/typereference.vala b/libvaladoc/api/typereference.vala
index 669c05423..b2cafb5b7 100644
--- a/libvaladoc/api/typereference.vala
+++ b/libvaladoc/api/typereference.vala
@@ -37,94 +37,12 @@ public class Valadoc.Api.TypeReference : Item {
                base (data);
 
                this.dbus_type_signature = dbus_type_signature;
-               this.pass_ownership = type_reference_pass_ownership (data);
                this.is_nullable = is_nullable;
                this.is_dynamic = is_dynamic;
                this.ownership = get_type_reference_ownership (data);
                this.parent = parent;
        }
 
-       bool is_reference_counting (Vala.TypeSymbol sym) {
-               return Vala.is_reference_counting (sym);
-       }
-
-       bool type_reference_pass_ownership (Vala.DataType? element) {
-               if (element == null) {
-                       return false;
-               }
-
-               weak Vala.CodeNode? node = element.parent_node;
-               if (node == null) {
-                       return false;
-               }
-               if (node is Vala.Parameter) {
-                       return (((Vala.Parameter)node).direction == Vala.ParameterDirection.IN &&
-                               ((Vala.Parameter)node).variable_type.value_owned);
-               }
-               if (node is Vala.Property) {
-                       return ((Vala.Property)node).property_type.value_owned;
-               }
-
-               return false;
-       }
-
-       bool is_type_reference_unowned (Vala.DataType? element) {
-                       if (element == null) {
-                               return false;
-                       }
-
-                       // non ref counted types are weak, not unowned
-                       if (element.type_symbol is Vala.TypeSymbol
-                               && is_reference_counting ((Vala.TypeSymbol) element.type_symbol) == true)
-                       {
-                               return false;
-                       }
-
-                       // FormalParameters are weak by default
-                       return (element.parent_node is Vala.Parameter == false)
-                               ? element.is_weak ()
-                               : false;
-       }
-
-       bool is_type_reference_owned (Vala.DataType? element) {
-               if (element == null) {
-                       return false;
-               }
-
-               weak Vala.CodeNode parent = element.parent_node;
-
-               // parameter:
-               if (parent is Vala.Parameter) {
-                       if (((Vala.Parameter)parent).direction != Vala.ParameterDirection.IN) {
-                               return false;
-                       }
-                       return ((Vala.Parameter)parent).variable_type.value_owned;
-               }
-
-               return false;
-       }
-
-       bool is_type_reference_weak (Vala.DataType? element) {
-               if (element == null) {
-                       return false;
-               }
-
-               // non ref counted types are unowned, not weak
-               if (element.type_symbol is Vala.TypeSymbol
-                       && is_reference_counting ((Vala.TypeSymbol) element.type_symbol) == false)
-               {
-                       return false;
-               }
-
-               // arrays are unowned, not weak
-               if (element is Vala.ArrayType) {
-                       return false;
-               }
-
-               // FormalParameters are weak by default
-               return (element.parent_node is Vala.Parameter == false)? element.is_weak () : false;
-       }
-
        Ownership get_type_reference_ownership (Vala.DataType? element) {
                unowned Vala.DataType? type = element;
                if (type != null) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]