code: def __sort_registry(self, svc_ref):
          # type: (ServiceReference) -> None
          
          with self.__svc_lock:
              if svc_ref not in self.__svc_registry:
                  raise BundleException("Unknown service: {0}".format(svc_ref))
  
              # Remove current references
              for spec in svc_ref.get_property(OBJECTCLASS):
                  # Use bisect to remove the reference (faster)
                  spec_refs = self.__svc_specs[spec]
                  idx = bisect.bisect_left(spec_refs, svc_ref)
                  del spec_refs[idx]
  
              # ... use the new sort key
              svc_ref.update_sort_key()
  
              for spec in svc_ref.get_property(OBJECTCLASS):
                  # ... and insert it again
                  spec_refs = self.__svc_specs[spec]
                  bisect.insort_left(spec_refs, svc_ref)
docs: Sorts the registry, after the update of the sort key of given service
          reference
  
          :param svc_ref: A service reference with a modified sort key