~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Martin Pool
  • Date: 2005-08-18 05:52:29 UTC
  • Revision ID: mbp@sourcefrog.net-20050818055229-cac46ebce364d04c
- avoid compiling REs at module load time

Show diffs side-by-side

added added

removed removed

Lines of Context:
644
644
 
645
645
 
646
646
 
647
 
_NAME_RE = re.compile(r'^[^/\\]+$')
 
647
_NAME_RE = None
648
648
 
649
649
def is_valid_name(name):
 
650
    global _NAME_RE
 
651
    if _NAME_RE == None:
 
652
        _NAME_RE = re.compile(r'^[^/\\]+$')
 
653
        
650
654
    return bool(_NAME_RE.match(name))