Changeset 6633:4efb975b6387


Ignore:
Timestamp:
09/25/07 08:08:14 (6 years ago)
Author:
Jason Grout <jason-sage@…>
Branch:
default
Message:

graphs: remove duplicate code in union().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sage/graphs/graph.py

    r6632 r6633  
    19721972            raise TypeError('Both arguments must be of the same class.') 
    19731973        if self.is_directed(): 
    1974             D = DiGraph() 
    1975             D.add_vertices(self.vertices()) 
    1976             D.add_vertices(other.vertices()) 
    1977             D.add_edges(self.edges()) 
    1978             D.add_edges(other.edges()) 
    1979             return D 
     1974            G = DiGraph() 
    19801975        else: 
    19811976            G = Graph() 
    1982             G.add_vertices(self.vertices()) 
    1983             G.add_vertices(other.vertices()) 
    1984             G.add_edges(self.edges()) 
    1985             G.add_edges(other.edges()) 
    1986             return G 
     1977        G.add_vertices(self.vertices()) 
     1978        G.add_vertices(other.vertices()) 
     1979        G.add_edges(self.edges()) 
     1980        G.add_edges(other.edges()) 
     1981        return G 
    19871982 
    19881983    def cartesian_product(self, other): 
Note: See TracChangeset for help on using the changeset viewer.